#34528

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


{
    return [&] (const ISerialization::SubstreamPath & path) -> WriteBuffer *
    {
        String data_file_name = ISerialization::getFileNameForStream(name_and_type, path);
        auto it = streams.find(data_file_name);
        if (it == streams.end())
            throw Exception("Logical error: stream was not created when writing data in LogSink",
                            ErrorCodes::LOGICAL_ERROR);
        Stream & stream = it->second;
        if (stream.written)
            return nullptr;
        return &stream.compressed;
    };
}
void LogSink::writeData(const NameAndTypePair & name_and_type, const IColumn & column)