From bc98324c1df74e858ce0f742bbae9e01c939283d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 3 Feb 2023 16:38:09 +0800 Subject: [PATCH] fix: correct ctg job error code --- source/libs/catalog/src/ctgAsync.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 325d6e0e46..f84f8e2917 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -906,9 +906,14 @@ int32_t ctgCallUserCb(void* param) { } void ctgUpdateJobErrCode(SCtgJob* pJob, int32_t errCode) { - if (!NEED_CLIENT_REFRESH_VG_ERROR(errCode) || errCode == TSDB_CODE_SUCCESS) return; + if (errCode == TSDB_CODE_SUCCESS) return; - atomic_store_32(&pJob->jobResCode, errCode); + if (NEED_CLIENT_HANDLE_ERROR(errCode)) { + atomic_store_32(&pJob->jobResCode, errCode); + } else if (0 != atomic_val_compare_exchange_32(&pJob->jobResCode, 0, errCode)) { + return; + } + qDebug("QID:0x%" PRIx64 " ctg job errCode updated to %s", pJob->queryId, tstrerror(errCode)); return; } -- GitLab