0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd::db: Add back the target level to range compact.

This commit is contained in:
Jason Volk 2018-09-20 23:30:00 -07:00
parent 795d62b1c7
commit ae36485d13
3 changed files with 5 additions and 4 deletions

View file

@ -60,7 +60,7 @@ namespace ircd::db
// [SET] Other operations
void setopt(column &, const string_view &key, const string_view &val);
void compact(column &, const std::pair<string_view, string_view> &, const compactor & = {});
void compact(column &, const std::pair<string_view, string_view> &, const int &to_level = -1, const compactor & = {});
void compact(column &, const int &level = -1, const compactor & = {});
void sort(column &, const bool &blocking = false);
}

View file

@ -358,7 +358,7 @@ ircd::db::compact(database &d,
for(const auto &c : d.columns)
{
db::column column{*c};
compact(column, range, cb);
compact(column, range, -1, cb);
compact(column, -1, cb);
}
}
@ -7505,6 +7505,7 @@ ircd::db::compact(column &column,
void
ircd::db::compact(column &column,
const std::pair<string_view, string_view> &range,
const int &to_level,
const compactor &cb)
{
database &d(column);
@ -7524,7 +7525,7 @@ ircd::db::compact(column &column,
rocksdb::CompactRangeOptions opts;
opts.change_level = true;
opts.target_level = -1;
opts.target_level = std::max(to_level, -1);
opts.allow_write_stall = true;
const ctx::uninterruptible::nothrow ui;

View file

@ -1245,7 +1245,7 @@ try
integer && end? byte_view<string_view>(integers[1]) : end,
};
compact(column, range);
compact(column, range, level);
if(level > -2)
compact(column, level);