mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix WriteBufferFromS3 is_finalized check in case of exception
WriteBufferFromS3::is_finalized is not set if finalizeImpl() throws, while WriteBuffer::finalized correctly set even in case of exception, so it should be used instead. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
b3b0716b32
commit
62d78d8f20
@ -152,7 +152,7 @@ void WriteBufferFromS3::allocateBuffer()
|
||||
WriteBufferFromS3::~WriteBufferFromS3()
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
if (!is_finalized)
|
||||
if (!finalized)
|
||||
{
|
||||
LOG_ERROR(log, "WriteBufferFromS3 is not finalized in destructor. It's a bug");
|
||||
std::terminate();
|
||||
@ -200,8 +200,6 @@ void WriteBufferFromS3::finalizeImpl()
|
||||
|
||||
if (!multipart_upload_id.empty())
|
||||
completeMultipartUpload();
|
||||
|
||||
is_finalized = true;
|
||||
}
|
||||
|
||||
void WriteBufferFromS3::createMultipartUpload()
|
||||
|
@ -106,7 +106,6 @@ private:
|
||||
std::vector<String> part_tags;
|
||||
|
||||
bool is_prefinalized = false;
|
||||
bool is_finalized = false;
|
||||
|
||||
/// Following fields are for background uploads in thread pool (if specified).
|
||||
/// We use std::function to avoid dependency of Interpreters
|
||||
|
Loading…
Reference in New Issue
Block a user