diff --git a/sstables/mp_row_consumer.cc b/sstables/mp_row_consumer.cc index 1e71f4ed60..75ad4e5920 100644 --- a/sstables/mp_row_consumer.cc +++ b/sstables/mp_row_consumer.cc @@ -44,6 +44,14 @@ namespace sstables { atomic_cell make_counter_cell(api::timestamp_type timestamp, bytes_view value) { static constexpr size_t shard_size = 32; + if (value.empty()) { + // This will never happen in a correct MC sstable but + // we had a bug #4363 that caused empty counters + // to be incorrectly stored inside sstables. + counter_cell_builder ccb; + return ccb.build(timestamp); + } + data_input in(value); auto header_size = in.read();