mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #65049 from ClickHouse/revert-64924-vdimir/blob_storage_log_minor_fixes
Revert "Fix duplicating Delete events in blob_storage_log"
This commit is contained in:
commit
0f279ca695
@ -382,7 +382,6 @@ void S3ObjectStorage::removeObjectsImpl(const StoredObjects & objects, bool if_e
|
|||||||
{
|
{
|
||||||
std::vector<Aws::S3::Model::ObjectIdentifier> current_chunk;
|
std::vector<Aws::S3::Model::ObjectIdentifier> current_chunk;
|
||||||
String keys;
|
String keys;
|
||||||
size_t first_position = current_position;
|
|
||||||
for (; current_position < objects.size() && current_chunk.size() < chunk_size_limit; ++current_position)
|
for (; current_position < objects.size() && current_chunk.size() < chunk_size_limit; ++current_position)
|
||||||
{
|
{
|
||||||
Aws::S3::Model::ObjectIdentifier obj;
|
Aws::S3::Model::ObjectIdentifier obj;
|
||||||
@ -408,9 +407,9 @@ void S3ObjectStorage::removeObjectsImpl(const StoredObjects & objects, bool if_e
|
|||||||
{
|
{
|
||||||
const auto * outcome_error = outcome.IsSuccess() ? nullptr : &outcome.GetError();
|
const auto * outcome_error = outcome.IsSuccess() ? nullptr : &outcome.GetError();
|
||||||
auto time_now = std::chrono::system_clock::now();
|
auto time_now = std::chrono::system_clock::now();
|
||||||
for (size_t i = first_position; i < current_position; ++i)
|
for (const auto & object : objects)
|
||||||
blob_storage_log->addEvent(BlobStorageLogElement::EventType::Delete,
|
blob_storage_log->addEvent(BlobStorageLogElement::EventType::Delete,
|
||||||
uri.bucket, objects[i].remote_path, objects[i].local_path, objects[i].bytes_size,
|
uri.bucket, object.remote_path, object.local_path, object.bytes_size,
|
||||||
outcome_error, time_now);
|
outcome_error, time_now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,10 +504,6 @@ void SystemLog<LogElement>::flushImpl(const std::vector<LogElement> & to_flush,
|
|||||||
Block block(std::move(log_element_columns));
|
Block block(std::move(log_element_columns));
|
||||||
|
|
||||||
MutableColumns columns = block.mutateColumns();
|
MutableColumns columns = block.mutateColumns();
|
||||||
|
|
||||||
for (auto & column : columns)
|
|
||||||
column->reserve(to_flush.size());
|
|
||||||
|
|
||||||
for (const auto & elem : to_flush)
|
for (const auto & elem : to_flush)
|
||||||
elem.appendToBlock(columns);
|
elem.appendToBlock(columns);
|
||||||
|
|
||||||
@ -536,8 +532,7 @@ void SystemLog<LogElement>::flushImpl(const std::vector<LogElement> & to_flush,
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__, fmt::format("Failed to flush system log {} with {} entries up to offset {}",
|
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||||
table_id.getNameForLogs(), to_flush.size(), to_flush_end));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
queue->confirm(to_flush_end);
|
queue->confirm(to_flush_end);
|
||||||
|
Loading…
Reference in New Issue
Block a user