MCPcopy Create free account
hub / github.com/ByConity/ByConity / precommit

Method precommit

src/Transaction/CnchWorkerTransaction.cpp:116–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void CnchWorkerTransaction::precommit()
117{
118 LOG_DEBUG(log, "Transaction {} starts pre commit\n", txn_record.txnID().toUInt64());
119 if (auto status = getStatus(); status != CnchTransactionStatus::Running)
120 throw Exception("Cannot precommit a transaction that is " + String(txnStatusToString(status)), ErrorCodes::LOGICAL_ERROR);
121 checkServerClient();
122 {
123 auto lock = getLock();
124 server_client->precommitTransaction(getContext(), getTransactionID(), getMainTableUUID());
125 txn_record.prepared = true;
126 }
127
128 assertLockAcquired();
129 LOG_DEBUG(log, "Transaction {} successfully finished pre commit.", txn_record.txnID().toUInt64());
130}
131
132TxnTimestamp CnchWorkerTransaction::commit()
133{

Callers

nothing calls this directly

Calls 7

txnStatusToStringFunction · 0.85
getLockFunction · 0.85
toUInt64Method · 0.80
ExceptionClass · 0.50
StringClass · 0.50
txnIDMethod · 0.45
precommitTransactionMethod · 0.45

Tested by

no test coverage detected