Do not touch /pool/stats from stats aggregation if PG recheck is active

This commit is contained in:
Vitaliy Filippov
2025-01-16 20:41:16 +03:00
parent 33ef701464
commit 7c9711af20
+19 -15
View File
@@ -773,23 +773,27 @@ class Mon
} }
} }
} }
for (const pool_id in this.state.pool.stats) if (!this.recheck_pgs_active)
{ {
if (!seen_pools[pool_id]) // PG recheck also modifies /pool/stats, so don't touch it here if it's active
for (const pool_id in this.state.pool.stats)
{ {
txn.push({ requestDeleteRange: { if (!seen_pools[pool_id])
key: b64(this.config.etcd_prefix+'/pool/stats/'+pool_id), {
} }); txn.push({ requestDeleteRange: {
delete this.state.pool.stats[pool_id]; key: b64(this.config.etcd_prefix+'/pool/stats/'+pool_id),
} } });
else delete this.state.pool.stats[pool_id];
{ }
const pool_stats = { ...this.state.pool.stats[pool_id] }; else
serialize_bigints(pool_stats); {
txn.push({ requestPut: { const pool_stats = { ...this.state.pool.stats[pool_id] };
key: b64(this.config.etcd_prefix+'/pool/stats/'+pool_id), serialize_bigints(pool_stats);
value: b64(JSON.stringify(pool_stats)), txn.push({ requestPut: {
} }); key: b64(this.config.etcd_prefix+'/pool/stats/'+pool_id),
value: b64(JSON.stringify(pool_stats)),
} });
}
} }
} }
if (txn.length) if (txn.length)