https://clickhouse-test-reports.s3.yandex.net/19475/02d28c1f9b9558ca5af267167a542819b9e1d061/fuzzer_debug/report.html#fail1
bytes_in_flush = total_bytes;
            row_count = inserted_blocks.row_count;
            bytes = inserted_blocks.bytes;
            inserted_blocks.clear();
        }
        else if (can_insert_more)
            flush_no = flush_number;
    }
    if (has_data_to_flush)
    {
        
        auto flushed = flush(current_blocks);
        current_blocks.clear();
        std::lock_guard lock{insert_mutex};
        sorted_files.emplace_back(std::move(flushed));
        row_count_in_flush -= row_count;
        bytes_in_flush -= bytes;
        
        ++flush_number;
        --flush_inflight;
        flush_condvar.notify_all();
    }
    else if (!can_insert_more)
    {
        
        std::unique_lock lock{insert_mutex};
        flush_condvar.wait(lock, [&]{ return flush_no < flush_number; });
    }
}
SortedBlocksWriter::TmpFilePtr SortedBlocksWriter::flush(const BlocksList & blocks) const