diff --git a/src/dnode/src/dnodeWrite.c b/src/dnode/src/dnodeWrite.c index 1e877108ca5c1cab10d02ba3b7c8a87e4fb825cf..c02ca950a7a91333db27727f89130b36e865a716 100644 --- a/src/dnode/src/dnodeWrite.c +++ b/src/dnode/src/dnodeWrite.c @@ -132,8 +132,6 @@ void *dnodeAllocateWqueue(void *pVnode) { taosCloseQueue(queue); return NULL; } - wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max; - pthread_attr_t thAttr; pthread_attr_init(&thAttr); pthread_attr_setdetachstate(&thAttr, PTHREAD_CREATE_JOINABLE); @@ -146,6 +144,7 @@ void *dnodeAllocateWqueue(void *pVnode) { queue = NULL; } else { dTrace("write worker:%d is launched", pWorker->workerId); + wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max; } pthread_attr_destroy(&thAttr);