0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 05:58:56 +02:00

ircd::db: Yield context on stall condition callback to relieve some pressure.

This commit is contained in:
Jason Volk 2020-09-24 02:49:29 -07:00
parent 9a15f712c5
commit 245921c2b6
2 changed files with 15 additions and 0 deletions

View file

@ -3158,6 +3158,8 @@ noexcept
info.num_entries,
info.num_deletes
};
ctx::yield();
}
void
@ -3250,6 +3252,8 @@ void
ircd::db::database::events::OnStallConditionsChanged(const rocksdb::WriteStallInfo &info)
noexcept
{
using rocksdb::WriteStallCondition;
const auto level
{
info.condition.cur == rocksdb::WriteStallCondition::kNormal?
@ -3266,6 +3270,16 @@ noexcept
reflect(info.condition.prev),
reflect(info.condition.cur)
};
int i
{
info.condition.prev == WriteStallCondition::kDelayed? 4:
info.condition.prev == WriteStallCondition::kStopped? 8:
0
};
while(i--)
ctx::yield();
}
///////////////////////////////////////////////////////////////////////////////

View file

@ -342,6 +342,7 @@ try
pretty(pbuf[3], iec(db_bytes / std::max(elapsed, 1L)), 1),
};
ctx::yield();
ctx::yield();
ctx::interruption_point();
}