Merge pull request #29338 from taosdata/fix/TD-33275.4
fix: catalog timer stop issue
This commit is contained in:
commit
4e8252734b
|
@ -1986,10 +1986,19 @@ void catalogDestroy(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gCtgMgmt.cacheTimer) {
|
if (gCtgMgmt.cacheTimer) {
|
||||||
if (taosTmrStop(gCtgMgmt.cacheTimer)) {
|
if (!taosTmrStop(gCtgMgmt.cacheTimer)) {
|
||||||
qTrace("stop catalog cache timer may failed");
|
/*
|
||||||
|
qDebug("catalog cacheTimer %" PRIuPTR " not stopped", (uintptr_t)gCtgMgmt.cacheTimer);
|
||||||
|
|
||||||
|
while (!taosTmrIsStopped(&gCtgMgmt.cacheTimer)) {
|
||||||
|
taosMsleep(1);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug("catalog cacheTimer %" PRIuPTR " is stopped", (uintptr_t)gCtgMgmt.cacheTimer);
|
||||||
gCtgMgmt.cacheTimer = NULL;
|
gCtgMgmt.cacheTimer = NULL;
|
||||||
|
|
||||||
taosTmrCleanUp(gCtgMgmt.timer);
|
taosTmrCleanUp(gCtgMgmt.timer);
|
||||||
gCtgMgmt.timer = NULL;
|
gCtgMgmt.timer = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,6 +480,8 @@ void ctgdShowDBCache(SCatalog *pCtg, SHashObj *dbHash) {
|
||||||
|
|
||||||
dbCache = (SCtgDBCache *)pIter;
|
dbCache = (SCtgDBCache *)pIter;
|
||||||
|
|
||||||
|
CTG_LOCK(CTG_READ, &dbCache->dbLock);
|
||||||
|
|
||||||
dbFName = taosHashGetKey(pIter, &len);
|
dbFName = taosHashGetKey(pIter, &len);
|
||||||
|
|
||||||
int32_t metaNum = dbCache->tbCache ? taosHashGetSize(dbCache->tbCache) : 0;
|
int32_t metaNum = dbCache->tbCache ? taosHashGetSize(dbCache->tbCache) : 0;
|
||||||
|
@ -509,6 +511,8 @@ void ctgdShowDBCache(SCatalog *pCtg, SHashObj *dbHash) {
|
||||||
hashMethod, hashPrefix, hashSuffix, vgNum);
|
hashMethod, hashPrefix, hashSuffix, vgNum);
|
||||||
|
|
||||||
if (dbCache->vgCache.vgInfo) {
|
if (dbCache->vgCache.vgInfo) {
|
||||||
|
CTG_LOCK(CTG_READ, &dbCache->vgCache.vgLock);
|
||||||
|
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
void *pVgIter = taosHashIterate(dbCache->vgCache.vgInfo->vgHash, NULL);
|
void *pVgIter = taosHashIterate(dbCache->vgCache.vgInfo->vgHash, NULL);
|
||||||
while (pVgIter) {
|
while (pVgIter) {
|
||||||
|
@ -524,6 +528,8 @@ void ctgdShowDBCache(SCatalog *pCtg, SHashObj *dbHash) {
|
||||||
|
|
||||||
pVgIter = taosHashIterate(dbCache->vgCache.vgInfo->vgHash, pVgIter);
|
pVgIter = taosHashIterate(dbCache->vgCache.vgInfo->vgHash, pVgIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CTG_UNLOCK(CTG_READ, &dbCache->vgCache.vgLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbCache->cfgCache.cfgInfo) {
|
if (dbCache->cfgCache.cfgInfo) {
|
||||||
|
@ -544,6 +550,8 @@ void ctgdShowDBCache(SCatalog *pCtg, SHashObj *dbHash) {
|
||||||
pCfg->schemaless, pCfg->sstTrigger);
|
pCfg->schemaless, pCfg->sstTrigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CTG_UNLOCK(CTG_READ, &dbCache->dbLock);
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
pIter = taosHashIterate(dbHash, pIter);
|
pIter = taosHashIterate(dbHash, pIter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,12 +149,13 @@ void ctgTestInitLogFile() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *defaultLogFileNamePrefix = "taoslog";
|
const char *defaultLogFileNamePrefix = "catalogTest";
|
||||||
const int32_t maxLogFileNum = 10;
|
const int32_t maxLogFileNum = 10;
|
||||||
|
|
||||||
tsAsyncLog = 0;
|
tsAsyncLog = 0;
|
||||||
qDebugFlag = 159;
|
qDebugFlag = 159;
|
||||||
tmrDebugFlag = 159;
|
tmrDebugFlag = 159;
|
||||||
|
tsNumOfLogLines = 1000000000;
|
||||||
TAOS_STRCPY(tsLogDir, TD_LOG_DIR_PATH);
|
TAOS_STRCPY(tsLogDir, TD_LOG_DIR_PATH);
|
||||||
|
|
||||||
(void)ctgdEnableDebug("api", true);
|
(void)ctgdEnableDebug("api", true);
|
||||||
|
@ -1839,7 +1840,7 @@ TEST(tableMeta, updateStbMeta) {
|
||||||
while (true) {
|
while (true) {
|
||||||
uint64_t n = 0;
|
uint64_t n = 0;
|
||||||
ASSERT(0 == ctgdGetStatNum("runtime.numOfOpDequeue", (void *)&n));
|
ASSERT(0 == ctgdGetStatNum("runtime.numOfOpDequeue", (void *)&n));
|
||||||
if (n != 3) {
|
if (n < 3) {
|
||||||
taosMsleep(50);
|
taosMsleep(50);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue