mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-09-09 15:02:19 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user