#34528

**Describe the bug**
[A link to the report](https://s3.amazonaws.com/clickhouse-test-reports/34528/6a8e35930ffc25f0574179c5ad93635cfe073121/stress_test__thread__actions_.html)


{
    if (done)
        return;
    for (auto & stream : streams | boost::adaptors::map_values)
        stream.written = false;
    ISerialization::SerializeBinaryBulkSettings settings;
    for (const auto & column : getHeader())
    {
        auto it = serialize_states.find(column.name);
        if (it != serialize_states.end())
        {
            settings.getter = createStreamGetter(NameAndTypePair(column.name, column.type));
            auto serialization = column.type->getDefaultSerialization();
            serialization->serializeBinaryBulkStateSuffix(settings, it->second);
        }
    }
    
    for (auto & stream : streams | boost::adaptors::map_values)
        stream.finalize();
    streams.clear();
    storage.saveMarks(lock);
    storage.saveFileSizes(lock);
    done = true;
    
    
    
    lock.unlock();
}
ISerialization::OutputStreamGetter LogSink::createStreamGetter(const NameAndTypePair & name_and_type)