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

Method removeOldPart

src/Interpreters/MergeTreeTransaction.cpp:105–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void MergeTreeTransaction::removeOldPart(const StoragePtr & storage, const DataPartPtr & part_to_remove, MergeTreeTransaction * txn)
106{
107 TransactionInfoContext transaction_context{storage->getStorageID(), part_to_remove->name};
108 if (txn)
109 {
110 /// Lock part for removal and write current TID into version metadata file.
111 /// If server crash just after committing transactions
112 /// we will find this TID in version metadata and will finally remove part.
113 txn->removeOldPart(storage, part_to_remove, transaction_context);
114 return;
115 }
116 part_to_remove->version->setAndStoreNonTransactionalRemovalTID(transaction_context);
117}
118
119void MergeTreeTransaction::addNewPartAndRemoveCovered(const StoragePtr & storage, const DataPartPtr & new_part, const DataPartsVector & covered_parts, MergeTreeTransaction * txn)
120{

Callers 1

Calls 7

checkNotOrdinaryDatabaseFunction · 0.85
lockRemovalTIDMethod · 0.80
setAndStoreRemovalTIDMethod · 0.80
getStorageIDMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected