This ability only makes sense as a step that allows to perform fsck before commiting recovered bluefs log.
Fixes: https://tracker.ceph.com/issues/46552
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
OPTION(bluefs_allocator, OPT_STR) // stupid | bitmap
OPTION(bluefs_log_replay_check_allocations, OPT_BOOL)
OPTION(bluefs_replay_recovery, OPT_BOOL)
+OPTION(bluefs_replay_recovery_disable_compact, OPT_BOOL)
OPTION(bluestore_bluefs, OPT_BOOL)
OPTION(bluestore_bluefs_env_mirror, OPT_BOOL) // mirror to normal Env for debug
"This options enables heuristics that scans devices for missing data. "
"DO NOT ENABLE BY DEFAULT"),
+ Option("bluefs_replay_recovery_disable_compact", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ .set_default(false)
+ .set_description(""),
+
Option("bluestore_bluefs", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(true)
.set_flag(Option::FLAG_CREATE)
void BlueFS::compact_log()
{
- std::unique_lock l(lock);
- if (cct->_conf->bluefs_compact_log_sync) {
- _compact_log_sync();
- } else {
- _compact_log_async(l);
+ std::unique_lock<ceph::mutex> l(lock);
+ if (!cct->_conf->bluefs_replay_recovery_disable_compact) {
+ if (cct->_conf->bluefs_compact_log_sync) {
+ _compact_log_sync();
+ } else {
+ _compact_log_async(l);
+ }
}
}
void BlueFS::_maybe_compact_log(std::unique_lock<ceph::mutex>& l)
{
- if (_should_compact_log()) {
+ if (!cct->_conf->bluefs_replay_recovery_disable_compact &&
+ _should_compact_log()) {
if (cct->_conf->bluefs_compact_log_sync) {
_compact_log_sync();
} else {