From f5cd00282c18675bcfc4e758d3d2e9982a7f7446 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Mon, 4 Nov 2019 13:45:45 +0800 Subject: [PATCH] Restore the state of the meter in case of failing to launch the update procedure. --- src/system/src/vnodeMeter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/src/vnodeMeter.c b/src/system/src/vnodeMeter.c index bba17327a2..b5cc5ae873 100644 --- a/src/system/src/vnodeMeter.c +++ b/src/system/src/vnodeMeter.c @@ -696,6 +696,9 @@ void vnodeUpdateMeter(void *param, void *tmrId) { pthread_mutex_unlock(&pVnode->vmutex); if (num > 0 || state != TSDB_METER_STATE_READY) { + // the state may have been changed by vnodeSetMeterState, recover it in the first place + vnodeClearMeterState(pObj, TSDB_METER_STATE_UPDATING); + dTrace("vid:%d sid:%d id:%s, update failed, retry later, numOfQueries:%d, state:%d", pNew->vnode, pNew->sid, pNew->meterId, num, state); -- GitLab