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

Function tryGetTransactionForMutation

src/Storages/StorageMergeTree.cpp:153–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static MergeTreeTransactionPtr tryGetTransactionForMutation(const MergeTreeMutationEntry & mutation, LoggerPtr log = nullptr)
154{
155 chassert(!mutation.tid.isEmpty());
156 if (mutation.tid.isNonTransactional())
157 return {};
158
159 auto txn = TransactionLog::instance().tryGetRunningTransaction(mutation.tid.getHash());
160 if (txn)
161 return txn;
162
163 if (log)
164 LOG_WARNING(log, "Cannot find transaction {} which had started mutation {}, probably it finished", mutation.tid, mutation.file_name);
165
166 return {};
167}
168
169static bool supportTransaction(const Disks & disks, LoggerPtr log)
170{

Callers 3

killMutationMethod · 0.85
selectPartsToMutateMethod · 0.85

Calls 4

isNonTransactionalMethod · 0.80
isEmptyMethod · 0.45
getHashMethod · 0.45

Tested by

no test coverage detected