fix(mito2): dec inflight compaction gauge after re-entrancy guard

DefaultNotifier::notify decremented INFLIGHT_COMPACTION_COUNT before the
re-entrancy guard, so a duplicate notify (which should never happen, but
the guard exists to defend against it) would decrement the gauge an
extra time and let it drift negative. Move the decrement after the
guard, matching the local compaction path's guard-then-account order.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
This commit is contained in:
Lei, HUANG
2026-07-23 17:23:38 +08:00
parent f89d9d1334
commit 7353a004a8
@@ -160,7 +160,6 @@ impl DefaultNotifier {
#[async_trait::async_trait]
impl Notifier for DefaultNotifier {
async fn notify(&self, result: RemoteJobResult, waiters: Vec<OutputTx>) {
INFLIGHT_COMPACTION_COUNT.dec();
let Some(execution) = self
.execution
.lock()
@@ -170,6 +169,7 @@ impl Notifier for DefaultNotifier {
error!("Remote compaction notifier invoked more than once");
return;
};
INFLIGHT_COMPACTION_COUNT.dec();
match result {
RemoteJobResult::CompactionJobResult(result) => {
let notify = {