fix catalog bug
This commit is contained in:
parent
9586e50a89
commit
aee28eb2fc
|
@ -280,6 +280,7 @@ int32_t taosAddClientLogCfg(SConfig *pCfg) {
|
||||||
if (cfgAddInt32(pCfg, "cDebugFlag", cDebugFlag, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "cDebugFlag", cDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "uDebugFlag", uDebugFlag, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "uDebugFlag", uDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "rpcDebugFlag", rpcDebugFlag, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "rpcDebugFlag", rpcDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
|
if (cfgAddInt32(pCfg, "qDebugFlag", qDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "tmrDebugFlag", tmrDebugFlag, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "tmrDebugFlag", tmrDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "jniDebugFlag", jniDebugFlag, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "jniDebugFlag", jniDebugFlag, 0, 255, 1) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1) != 0) return -1;
|
if (cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1) != 0) return -1;
|
||||||
|
@ -458,6 +459,7 @@ static void taosSetClientLogCfg(SConfig *pCfg) {
|
||||||
tsLogKeepDays = cfgGetItem(pCfg, "logKeepDays")->i32;
|
tsLogKeepDays = cfgGetItem(pCfg, "logKeepDays")->i32;
|
||||||
cDebugFlag = cfgGetItem(pCfg, "cDebugFlag")->i32;
|
cDebugFlag = cfgGetItem(pCfg, "cDebugFlag")->i32;
|
||||||
uDebugFlag = cfgGetItem(pCfg, "uDebugFlag")->i32;
|
uDebugFlag = cfgGetItem(pCfg, "uDebugFlag")->i32;
|
||||||
|
qDebugFlag = cfgGetItem(pCfg, "qDebugFlag")->i32;
|
||||||
rpcDebugFlag = cfgGetItem(pCfg, "rpcDebugFlag")->i32;
|
rpcDebugFlag = cfgGetItem(pCfg, "rpcDebugFlag")->i32;
|
||||||
tmrDebugFlag = cfgGetItem(pCfg, "tmrDebugFlag")->i32;
|
tmrDebugFlag = cfgGetItem(pCfg, "tmrDebugFlag")->i32;
|
||||||
jniDebugFlag = cfgGetItem(pCfg, "jniDebugFlag")->i32;
|
jniDebugFlag = cfgGetItem(pCfg, "jniDebugFlag")->i32;
|
||||||
|
|
|
@ -841,6 +841,8 @@ int32_t ctgGetTableMetaFromCache(SCatalog* pCtg, const SName* pTableName, STable
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctgDebug("Got subtable meta from cache, type:%d, dbFName:%s, tbName:%s, suid:%" PRIx64, tbMeta->tableType, dbFName, pTableName->tname, tbMeta->suid);
|
||||||
|
|
||||||
CTG_LOCK(CTG_READ, &dbCache->tbCache.stbLock);
|
CTG_LOCK(CTG_READ, &dbCache->tbCache.stbLock);
|
||||||
|
|
||||||
|
@ -1655,6 +1657,11 @@ int32_t ctgUpdateTblMeta(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFName, ui
|
||||||
STableMeta *orig = taosHashGet(tbCache->metaCache, tbName, strlen(tbName));
|
STableMeta *orig = taosHashGet(tbCache->metaCache, tbName, strlen(tbName));
|
||||||
if (orig) {
|
if (orig) {
|
||||||
origType = orig->tableType;
|
origType = orig->tableType;
|
||||||
|
|
||||||
|
if (origType == meta->tableType && orig->uid == meta->uid && orig->sversion >= meta->sversion && orig->tversion >= meta->tversion) {
|
||||||
|
CTG_UNLOCK(CTG_READ, &tbCache->metaLock);
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (origType == TSDB_SUPER_TABLE) {
|
if (origType == TSDB_SUPER_TABLE) {
|
||||||
if ((!isStb) || orig->suid != meta->suid) {
|
if ((!isStb) || orig->suid != meta->suid) {
|
||||||
|
@ -1693,7 +1700,7 @@ int32_t ctgUpdateTblMeta(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFName, ui
|
||||||
CTG_CACHE_STAT_ADD(tblNum, 1);
|
CTG_CACHE_STAT_ADD(tblNum, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctgDebug("tbmeta updated to cache, dbFName:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
ctgDebug("tbmeta updated to cache, dbFName:%s, tbName:%s, tbType:%d, suid:%" PRIx64, dbFName, tbName, meta->tableType, meta->suid);
|
||||||
ctgdShowTableMeta(pCtg, tbName, meta);
|
ctgdShowTableMeta(pCtg, tbName, meta);
|
||||||
|
|
||||||
if (!isStb) {
|
if (!isStb) {
|
||||||
|
@ -1701,12 +1708,6 @@ int32_t ctgUpdateTblMeta(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFName, ui
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (origType == TSDB_SUPER_TABLE && origSuid == meta->suid) {
|
|
||||||
CTG_UNLOCK(CTG_WRITE, &tbCache->stbLock);
|
|
||||||
CTG_UNLOCK(CTG_READ, &tbCache->metaLock);
|
|
||||||
return TSDB_CODE_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
STableMeta *tbMeta = taosHashGet(tbCache->metaCache, tbName, strlen(tbName));
|
STableMeta *tbMeta = taosHashGet(tbCache->metaCache, tbName, strlen(tbName));
|
||||||
if (taosHashPut(tbCache->stbCache, &meta->suid, sizeof(meta->suid), &tbMeta, POINTER_BYTES) != 0) {
|
if (taosHashPut(tbCache->stbCache, &meta->suid, sizeof(meta->suid), &tbMeta, POINTER_BYTES) != 0) {
|
||||||
CTG_UNLOCK(CTG_WRITE, &tbCache->stbLock);
|
CTG_UNLOCK(CTG_WRITE, &tbCache->stbLock);
|
||||||
|
@ -1721,7 +1722,7 @@ int32_t ctgUpdateTblMeta(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFName, ui
|
||||||
|
|
||||||
CTG_UNLOCK(CTG_READ, &tbCache->metaLock);
|
CTG_UNLOCK(CTG_READ, &tbCache->metaLock);
|
||||||
|
|
||||||
ctgDebug("stb updated to stbCache, dbFName:%s, tbName:%s, tbType:%d", dbFName, tbName, meta->tableType);
|
ctgDebug("stb updated to stbCache, dbFName:%s, tbName:%s, tbType:%d, suid:%" PRIx64 ",ma:%p", dbFName, tbName, meta->tableType, meta->suid, tbMeta);
|
||||||
|
|
||||||
SSTableMetaVersion metaRent = {.dbId = dbId, .suid = meta->suid, .sversion = meta->sversion, .tversion = meta->tversion};
|
SSTableMetaVersion metaRent = {.dbId = dbId, .suid = meta->suid, .sversion = meta->sversion, .tversion = meta->tversion};
|
||||||
strcpy(metaRent.dbFName, dbFName);
|
strcpy(metaRent.dbFName, dbFName);
|
||||||
|
|
|
@ -290,6 +290,10 @@ int32_t queryCreateTableMetaFromMsg(STableMetaRsp *msg, bool isSuperTable, STabl
|
||||||
pTableMeta->sversion = msg->sversion;
|
pTableMeta->sversion = msg->sversion;
|
||||||
pTableMeta->tversion = msg->tversion;
|
pTableMeta->tversion = msg->tversion;
|
||||||
|
|
||||||
|
if (isSuperTable) {
|
||||||
|
qDebug("stable %s meta returned, suid:%" PRIx64, msg->stbName, pTableMeta->suid);
|
||||||
|
}
|
||||||
|
|
||||||
pTableMeta->tableInfo.numOfTags = msg->numOfTags;
|
pTableMeta->tableInfo.numOfTags = msg->numOfTags;
|
||||||
pTableMeta->tableInfo.precision = msg->precision;
|
pTableMeta->tableInfo.precision = msg->precision;
|
||||||
pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
|
pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
|
||||||
|
|
|
@ -40,7 +40,7 @@ class TDSimClient:
|
||||||
"cDebugFlag": "135",
|
"cDebugFlag": "135",
|
||||||
"udebugFlag": "135",
|
"udebugFlag": "135",
|
||||||
"jnidebugFlag": "135",
|
"jnidebugFlag": "135",
|
||||||
"qdebugFlag": "135",
|
"qdebugFlag": "143",
|
||||||
"telemetryReporting": "0",
|
"telemetryReporting": "0",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ from util.dnodes import *
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
|
|
||||||
clientCfgDict = {'qdebugflag':'143'}
|
#clientCfgDict = {'qdebugflag':'143'}
|
||||||
updatecfgDict = {'clientCfg': {}, 'qdebugflag':'143'}
|
#updatecfgDict = {'clientCfg': {}, 'qdebugflag':'143'}
|
||||||
updatecfgDict["clientCfg"] = clientCfgDict
|
#updatecfgDict["clientCfg"] = clientCfgDict
|
||||||
print ("===================: ", updatecfgDict)
|
#print ("===================: ", updatecfgDict)
|
||||||
|
|
||||||
def init(self, conn, logSql):
|
def init(self, conn, logSql):
|
||||||
tdLog.debug(f"start to excute {__file__}")
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
|
Loading…
Reference in New Issue