Skip to content

Commit

Permalink
WIP sstable: seal_sstable: link staging sstables to base dir
Browse files Browse the repository at this point in the history
staging sstables need to be compacted as any other sstable.
In particular, they need to be subject to cleanup compaction
and scrubbing.

To achieve that, link them to the base dir when sealed.
When moved out of staging, table::move_sstables_from_staging
already unlinks the sstable from the staging subdirectory
if its get_dir() is set to the base dir.

Fix scylladb#9559

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
  • Loading branch information
bhalevy committed Feb 14, 2022
1 parent f69b91f commit 2e242c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sstables/sstables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,12 @@ future<> sstable::seal_sstable() {
}
// If this point was reached, sstable should be safe in disk.
sstlog.debug("SSTable with generation {} of {}.{} was sealed successfully.", _generation, _schema->ks_name(), _schema->cf_name());
if (requires_view_building()) {
sstlog.debug("Linking {} to base directory", _generation, _schema->ks_name(), _schema->cf_name());
sstring base_dir = fs::path(_dir).parent_path().native();
co_await create_links(base_dir, _generation);
_dir = std::move(base_dir);
}
}

void sstable::write_crc(const checksum& c) {
Expand Down

0 comments on commit 2e242c0

Please sign in to comment.