diff --git a/sstables/storage.cc b/sstables/storage.cc index 23d4fea3c4..cecff9ebfe 100644 --- a/sstables/storage.cc +++ b/sstables/storage.cc @@ -151,7 +151,7 @@ void filesystem_storage::open(sstable& sst) { // TOC will exist at this point if write_components() was called with // the generation of a sstable that exists. w.close(); - remove_file(file_path).get(); + remove_file(sst.filename(component_type::TemporaryTOC)).get(); throw std::runtime_error(format("SSTable write failed due to existence of TOC file for generation {} of {}.{}", sst._generation, sst._schema->ks_name(), sst._schema->cf_name())); }