MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / tryGetCSN

Method tryGetCSN

src/Interpreters/MergeTreeTransaction/VersionMetadata.cpp:436–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436CSN VersionMetadata::tryGetCSN(TransactionID tid)
437{
438 auto csn = TransactionLog::getCSN(tid);
439 if (!csn && TransactionLog::instance().tryGetRunningTransaction(tid.getHash()) == nullptr)
440 {
441 /// CSN might be updated during the gap between TransactionLog::getCSN and TransactionLog::instance().tryGetRunningTransaction
442 csn = TransactionLog::getCSN(tid);
443
444 /// The transaction is not running, and has no CSN -> it is rolled back
445 if (!csn)
446 {
447 LOG_TRACE(log, "Object {}, tid {} is rolled back", getObjectName(), tid);
448 return Tx::RolledBackCSN;
449 }
450 }
451 LOG_TRACE(log, "Object {}, tid {}, try get csn {}", getObjectName(), tid, csn);
452 return csn;
453}
454
455void VersionMetadata::validateInfo(const String & object_name, const VersionInfo & info)
456{

Callers

nothing calls this directly

Calls 2

getHashMethod · 0.45

Tested by

no test coverage detected