sstables: feed new sstable with its owner shard

Missed opportunity to feed shard id to sstable being written when
working on 67c5c8dc67, so when sstable is reopened after sealed,
its shard doesn't need to be recomputed by open procedure.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <20171231024529.13664-1-raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2017-12-31 00:45:29 -02:00
committed by Avi Kivity
parent d7a91f5b84
commit 3dcf00ec67

View File

@@ -1305,7 +1305,9 @@ future<> sstable::open_data() {
_data_file = std::get<file>(std::get<1>(files).get());
return this->update_info_for_opened_data();
}).then([this] {
_shards = compute_shards_for_this_sstable();
if (_shards.empty()) {
_shards = compute_shards_for_this_sstable();
}
});
}
@@ -2318,6 +2320,7 @@ sstable_writer::sstable_writer(sstable& sst, const schema& s, uint64_t estimated
_compression_enabled = !_sst.has_component(sstable::component_type::CRC);
prepare_file_writer();
_components_writer.emplace(_sst, _schema, *_writer, estimated_partitions, cfg, _pc);
_sst._shards = { shard };
}
static sstable_enabled_features all_features() {