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

Method precommit

src/Transaction/CnchExplicitTransaction.cpp:48–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void CnchExplicitTransaction::precommit()
49{
50 /// Sync all transaction record; throw exception if status missmatch
51 std::for_each(secondary_txns.begin(), secondary_txns.end(), [](auto & txn) {
52 if (auto proxy_txn = txn->template as<CnchProxyTransaction>())
53 proxy_txn->syncTransactionStatus(/*throw_on_missmatch=*/true);
54 });
55 /// If a transaction fails, make sure that all parts metadata in bytekv of that txn is removed before commit
56 std::for_each(secondary_txns.begin(), secondary_txns.end(), [](auto & txn) {
57 if (txn->getStatus() == CnchTransactionStatus::Aborted)
58 txn->removeIntermediateData();
59 });
60 txn_record.prepared = true;
61}
62
63TxnTimestamp CnchExplicitTransaction::commit()
64{

Callers

nothing calls this directly

Calls 5

syncTransactionStatusMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getStatusMethod · 0.45

Tested by

no test coverage detected