mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 09:00:35 +00:00
Garbage collected sstables created during incremental compaction are deleted only at the end of the compaction, which increases the memory footprint. This is inefficient, especially considering that the related input sstables are released regularly during compaction. This commit implements incremental release of GC sstables after each output sstable is sealed. Unlike regular input sstables, GC sstables use a different exhaustion predicate: a GC sstable is only released when its token range no longer overlaps with any remaining input sstable. This is because GC sstables hold tombstones that may shadow data in still-alive overlapping input sstables; releasing them prematurely would cause data resurrection. Fixes #5563 Closes scylladb/scylladb#28984
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2020-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
|
|
*/
|
|
#pragma once
|
|
#include <seastar/util/log.hh>
|
|
|
|
// A test log to use in all unit tests, including boost unit
|
|
// tests. Built-in boost logging log levels do not allow to filter
|
|
// out unimportant messages, which then clutter xunit-format XML
|
|
// output, so are not used for anything profuse.
|
|
|
|
extern seastar::logger testlog;
|
|
|
|
|
|
// RAII helper that sets a logger to the given level for the duration of a scope,
|
|
// restoring the previous level on destruction.
|
|
class scoped_logger_level {
|
|
seastar::sstring _name;
|
|
seastar::log_level _prev_level;
|
|
public:
|
|
scoped_logger_level(seastar::sstring name, seastar::log_level level)
|
|
: _name(std::move(name))
|
|
, _prev_level(seastar::global_logger_registry().get_logger_level(_name))
|
|
{
|
|
seastar::global_logger_registry().set_logger_level(_name, level);
|
|
}
|
|
~scoped_logger_level() {
|
|
seastar::global_logger_registry().set_logger_level(_name, _prev_level);
|
|
}
|
|
scoped_logger_level(const scoped_logger_level&) = delete;
|
|
scoped_logger_level& operator=(const scoped_logger_level&) = delete;
|
|
};
|