MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / commit_tx

Method commit_tx

crates/engine/src/relational_db.rs:817–835  ·  view source on GitHub ↗
(
        &self,
        tx: MutTx,
    )

Source from the content-addressed store, hash-verified

815 #[tracing::instrument(level = "trace", skip_all)]
816 #[allow(clippy::type_complexity)]
817 pub fn commit_tx(
818 &self,
819 tx: MutTx,
820 ) -> Result<Option<(TxOffset, Arc<TxData>, TxMetrics, Option<ReducerName>)>, DBError> {
821 log::trace!("COMMIT MUT TX");
822
823 let reducer_context = tx.ctx.reducer_context().cloned();
824 // TODO: Never returns `None` -- should it?
825 let Some((tx_offset, tx_data, tx_metrics, reducer)) = self.inner.commit_mut_tx_and_then(tx, |tx_data| {
826 self.request_durability(reducer_context, tx_data);
827 })?
828 else {
829 return Ok(None);
830 };
831
832 self.maybe_do_snapshot(&tx_data);
833
834 Ok(Some((tx_offset, tx_data, tx_metrics, reducer)))
835 }
836
837 #[tracing::instrument(level = "trace", skip_all)]
838 pub fn commit_tx_downgrade(&self, tx: MutTx, workload: Workload) -> (Arc<TxData>, TxMetrics, Tx) {

Callers 15

run_innerFunction · 0.80
init_database_innerFunction · 0.80
guard_mut_txMethod · 0.80
update_db_repro_2761Function · 0.80
create_backing_tableFunction · 0.80
replay_event_table_dropFunction · 0.80
migrate_system_tablesMethod · 0.80

Calls 5

reducer_contextMethod · 0.80
request_durabilityMethod · 0.80
maybe_do_snapshotMethod · 0.80
OkFunction · 0.50