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

Method commit

src/Disks/DiskObjectStorage/DiskObjectStorageTransaction.cpp:532–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532void DiskObjectStorageTransaction::commit()
533{
534 auto component_guard = Coordination::setCurrentComponent("DiskObjectStorageTransaction::commit");
535 for (size_t i = 0; i < operations_to_execute.size(); ++i)
536 {
537 try
538 {
539 operations_to_execute[i](metadata_transaction);
540 }
541 catch (...)
542 {
543 tryLogCurrentException(
544 getLogger("DiskObjectStorageTransaction"),
545 fmt::format("An error occurred while executing transaction's operation #{}", i));
546
547 undo();
548
549 throw;
550 }
551 }
552
553 try
554 {
555 fiu_do_on(FailPoints::disk_object_storage_fail_commit_metadata_transaction,
556 {
557 throw Exception(ErrorCodes::FAULT_INJECTED, "disk_object_storage_fail_commit_metadata_transaction");
558 });
559
560 metadata_transaction->commit(NoCommitOptions{});
561 }
562 catch (...)
563 {
564 undo();
565 throw;
566 }
567
568 if (wait_blob_removal)
569 waitBlobRemoval(metadata_transaction->getSubmittedForRemovalBlobs());
570
571 operations_to_execute.clear();
572 written_blobs.clear();
573 LOG_TEST(getLogger("DiskObjectStorageTransaction"), "Transaction committed successfully");
574}
575
576TransactionCommitOutcomeVariant DiskObjectStorageTransaction::tryCommit(const TransactionCommitOptionsVariant & options)
577{

Callers 15

writeFileImplMethod · 0.45
createFileMethod · 0.45
moveDirectoryMethod · 0.45
moveFileMethod · 0.45
truncateFileMethod · 0.45
copyFileMethod · 0.45
replaceFileMethod · 0.45
renameExchangeMethod · 0.45
removeSharedFileMethod · 0.45
removeSharedFilesMethod · 0.45
createHardLinkMethod · 0.45
setReadOnlyMethod · 0.45

Calls 8

setCurrentComponentFunction · 0.85
tryLogCurrentExceptionFunction · 0.50
getLoggerFunction · 0.50
formatFunction · 0.50
ExceptionClass · 0.50
sizeMethod · 0.45
clearMethod · 0.45

Tested by 4

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36