mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
table: Fix schema mismatch between memtable reader and sstable writer
The schema used to create the sstable writer has to be the same as the
schema used by the reader, as the former is used to intrpret mutation
fragments produced by the reader.
Commit 9124a70 intorduced a deferring point between reader creation
and writer creation which can result in schema mismatch if there was a
concurrent alter.
This could lead to the sstable write to crash, or generate a corrupted
sstable.
Fixes #7994
Message-Id: <20210222153149.289308-1-tgrabiec@scylladb.com>
This commit is contained in:
committed by
Avi Kivity
parent
81d773e5d8
commit
fb1d3fe2cf
3
table.cc
3
table.cc
@@ -1698,7 +1698,8 @@ write_memtable_to_sstable(flat_mutation_reader reader,
|
||||
cfg.replay_position = mt.replay_position();
|
||||
cfg.monitor = &monitor;
|
||||
cfg.origin = "memtable";
|
||||
return sst->write_components(std::move(reader), mt.partition_count(), mt.schema(), cfg, mt.get_encoding_stats(), pc);
|
||||
schema_ptr s = reader.schema();
|
||||
return sst->write_components(std::move(reader), mt.partition_count(), s, cfg, mt.get_encoding_stats(), pc);
|
||||
}
|
||||
|
||||
future<>
|
||||
|
||||
Reference in New Issue
Block a user