mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-04 22:13:19 +00:00
sstables: fix load_metadata to check S3 for scylla metadata component
sstable_stream_sink_impl::load_metadata() used file_exists() on a local filesystem path to check whether the Scylla metadata component exists. For S3-backed storage this always returns false because the file lives on object storage, not locally. This means that when streaming encrypted SSTables, each component gets a fresh encryption key (because the previous key from scylla metadata is never loaded). Only the last key survives in the metadata on S3, so all other components become unreadable — decryption with the wrong key produces garbage, leading to parse failures or OOM crashes on sst->load(). Replace file_exists() with _sst->_storage->exists() which correctly checks for the component on whatever backend the SSTable uses (local filesystem or object storage). Fixes https://scylladb.atlassian.net/browse/SCYLLADB-1704
This commit is contained in:
@@ -4281,8 +4281,7 @@ public:
|
||||
{}
|
||||
private:
|
||||
future<> load_metadata() const {
|
||||
auto metafile = _sst->filename(sstables::component_type::Scylla);
|
||||
if (!co_await file_exists(fmt::to_string(metafile))) {
|
||||
if (!co_await _sst->_storage->exists(*_sst, component_type::Scylla)) {
|
||||
// for compatibility with streaming a non-scylla table (no scylla component)
|
||||
co_return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user