diff --git a/src/dnode/src/dnodeVWrite.c b/src/dnode/src/dnodeVWrite.c index dc09a03e1497cb52718279b542e3318fb2789d08..51bc8890fcd98b6f5dee4c88d2858990e68bc2a3 100644 --- a/src/dnode/src/dnodeVWrite.c +++ b/src/dnode/src/dnodeVWrite.c @@ -38,6 +38,8 @@ typedef struct { typedef struct { SRspRet rspRet; + int32_t processedCount; + int32_t code; void *pCont; int32_t contLen; SRpcMsg rpcMsg; @@ -187,13 +189,16 @@ void dnodeFreeVnodeWqueue(void *wqueue) { void dnodeSendRpcVnodeWriteRsp(void *pVnode, void *param, int32_t code) { SWriteMsg *pWrite = (SWriteMsg *)param; - if (code > 0) return; + if (code < 0) pWrite->code = code; + int32_t count = atomic_add_fetch_32(&pWrite->processedCount, 1); + + if (count <= 1) return; SRpcMsg rpcRsp = { .handle = pWrite->rpcMsg.handle, .pCont = pWrite->rspRet.rsp, .contLen = pWrite->rspRet.len, - .code = code, + .code = pWrite->code, }; rpcSendResponse(&rpcRsp); @@ -239,7 +244,10 @@ static void *dnodeProcessWriteQueue(void *param) { } int32_t code = vnodeProcessWrite(pVnode, type, pHead, pRspRet); - if (pWrite) pWrite->rpcMsg.code = code; + if (pWrite) { + pWrite->rpcMsg.code = code; + if (code <= 0) pWrite->processedCount = 1; + } } walFsync(vnodeGetWal(pVnode)); diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index 09bbbd8f4d199f994fdde6623fae75f65a628f24..ddb935b7e598de3818968d217fe1cfc671ca920a 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -69,8 +69,8 @@ int tsdbCreateTable(TSDB_REPO_T *repo, STableCfg *pCfg) { if (tid < pMeta->maxTables && pMeta->tables[tid] != NULL) { if (TABLE_UID(pMeta->tables[tid]) == pCfg->tableId.uid) { - tsdbError("vgId:%d table %s already exists, tid %d uid %" PRId64, REPO_ID(pRepo), TABLE_CHAR_NAME(pTable), - TABLE_TID(pTable), TABLE_UID(pTable)); + tsdbError("vgId:%d table %s already exists, tid %d uid %" PRId64, REPO_ID(pRepo), TABLE_CHAR_NAME(pMeta->tables[tid]), + TABLE_TID(pMeta->tables[tid]), TABLE_UID(pMeta->tables[tid])); return TSDB_CODE_TDB_TABLE_ALREADY_EXIST; } else { tsdbError("vgId:%d table %s at tid %d uid %" PRIu64 @@ -1295,4 +1295,4 @@ static int tsdbAdjustMetaTables(STsdbRepo *pRepo, int tid) { tsdbDebug("vgId:%d tsdb meta maxTables is adjusted as %d", REPO_ID(pRepo), maxTables); return 0; -} \ No newline at end of file +} diff --git a/tests/script/unique/clusterSimCase/client-06.sim b/tests/script/unique/clusterSimCase/client-06.sim index 4238a93cf036e04a7b5f74b9c09deece999c244b..013eb1db85f6665dd2b5090a0999d1e355ad1e93 100644 --- a/tests/script/unique/clusterSimCase/client-06.sim +++ b/tests/script/unique/clusterSimCase/client-06.sim @@ -9,6 +9,7 @@ $tsStart = 1325347200000 # 2012-01-01 00:00:00.000 $preBinary = ' . client-06- $numPerUpdateTbl = 2000 ############################################################### +$testCnt = 0 $totalRows = 0 $dropTblStart = $tblStart @@ -90,7 +91,11 @@ if $loopCnt > 2 then $totalRows = $totalRows - $rowsPerTbl endw sleep 20000 + $testCnt = $testCnt + 1 goto init_lable endi +if $testCnt > 10 then + return 0 +endi goto loop_run