mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix abort in temporary data in cache
This commit is contained in:
parent
f85d967f11
commit
acd7292be0
@ -54,10 +54,18 @@ WriteBufferToFileSegment::WriteBufferToFileSegment(FileSegmentsHolderPtr segment
|
||||
void WriteBufferToFileSegment::nextImpl()
|
||||
{
|
||||
auto downloader [[maybe_unused]] = file_segment->getOrSetDownloader();
|
||||
chassert(downloader == FileSegment::getCallerId());
|
||||
if (downloader != FileSegment::getCallerId())
|
||||
{
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR,
|
||||
"Failed to set a downloader (current downloader: {}, file segment info: {})",
|
||||
downloader, file_segment->getInfoForLog());
|
||||
}
|
||||
|
||||
SCOPE_EXIT({
|
||||
file_segment->completePartAndResetDownloader();
|
||||
if (file_segment->isDownloader())
|
||||
file_segment->completePartAndResetDownloader();
|
||||
else
|
||||
chassert(false);
|
||||
});
|
||||
|
||||
size_t bytes_to_write = offset();
|
||||
|
Loading…
Reference in New Issue
Block a user