0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::db: Mask interruption for compaction operations.

This commit is contained in:
Jason Volk 2018-08-17 14:00:21 -07:00
parent eca3a5b85b
commit bf429e0c9e

View file

@ -2257,6 +2257,8 @@ noexcept
pool([this, &tasks] pool([this, &tasks]
{ {
ctx::uninterruptible::nothrow ui;
assert(this->st); assert(this->st);
if(tasks.empty()) if(tasks.empty())
return; return;
@ -2288,6 +2290,8 @@ ircd::db::database::env::UnSchedule(void *const tag,
const Priority prio) const Priority prio)
noexcept noexcept
{ {
ctx::uninterruptible::nothrow ui;
#ifdef RB_DEBUG_DB_ENV #ifdef RB_DEBUG_DB_ENV
log::debug log::debug
{ {
@ -4900,6 +4904,13 @@ ircd::db::compact(column &column,
d.d->GetColumnFamilyMetaData(c, &cfmd); d.d->GetColumnFamilyMetaData(c, &cfmd);
for(const auto &level : cfmd.levels) for(const auto &level : cfmd.levels)
{ {
// The operations in this loop might last a while. We don't want
// to play games with the stack while rocksdb is in work, so we
// mask interruptions during each iteration. The interruption will
// be thrown either at ctor OR DTOR of this object if requested.
ctx::interruption_point();
ctx::uninterruptible::nothrow ui;
if(level_ != -1 && level.level != level_) if(level_ != -1 && level.level != level_)
continue; continue;
@ -4936,6 +4947,12 @@ ircd::db::compact(column &column,
const std::pair<string_view, string_view> &range, const std::pair<string_view, string_view> &range,
const int &to_level) const int &to_level)
{ {
// We don't want to play games with the stack while rocksdb is in work,
// interruptions are masked for this frame. An interruption will be
// thrown either at ctor OR DTOR of this object if requested.
ctx::interruption_point();
ctx::uninterruptible::nothrow ui;
database::column &c(column); database::column &c(column);
database &d(*c.d); database &d(*c.d);