提交 908de1b3 编写于 作者: D dapan1121

fix: sysdb cache removed cause of drop db operation

上级 842217e7
......@@ -20,6 +20,7 @@
#include "query.h"
#include "tdef.h"
#include "tname.h"
#include "systable.h"
static void setErrno(SRequestObj* pRequest, int32_t code) {
pRequest->code = code;
......@@ -326,6 +327,8 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
int32_t code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
if (TSDB_CODE_SUCCESS == code) {
catalogRemoveDB(pCatalog, dropdbRsp.db, dropdbRsp.uid);
catalogRemoveDB(pCatalog, TSDB_INFORMATION_SCHEMA_DB, 0);
catalogRemoveDB(pCatalog, TSDB_PERFORMANCE_SCHEMA_DB, 0);
}
}
......
......@@ -1076,6 +1076,9 @@ int32_t catalogRefreshTableMeta(SCatalog* pCtg, SRequestConnInfo* pConn, const S
SCtgTbMetaCtx ctx = {0};
ctx.pName = (SName*)pTableName;
ctx.flag = CTG_FLAG_FORCE_UPDATE | CTG_FLAG_MAKE_STB(isSTable);
if (IS_SYS_DBNAME(ctx.pName->dbname)) {
CTG_FLAG_SET_SYS_DB(ctx.flag);
}
CTG_API_LEAVE(ctgRefreshTbMeta(pCtg, pConn, &ctx, NULL, true));
}
......
......@@ -663,6 +663,7 @@ int32_t ctgDropDbCacheEnqueue(SCatalog *pCtg, const char *dbFName, int64_t dbId)
int32_t code = 0;
SCtgCacheOperation *op = taosMemoryCalloc(1, sizeof(SCtgCacheOperation));
op->opId = CTG_OP_DROP_DB_CACHE;
op->syncOp = true;
SCtgDropDBMsg *msg = taosMemoryMalloc(sizeof(SCtgDropDBMsg));
if (NULL == msg) {
......@@ -1612,11 +1613,11 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
dbCache = NULL;
if (!IS_SYS_DBNAME(dbFName)) {
//if (!IS_SYS_DBNAME(dbFName)) {
tstrncpy(vgVersion.dbFName, dbFName, sizeof(vgVersion.dbFName));
CTG_ERR_JRET(ctgMetaRentUpdate(&msg->pCtg->dbRent, &vgVersion, vgVersion.dbId, sizeof(SDbVgVersion),
ctgDbVgVersionSortCompare, ctgDbVgVersionSearchCompare));
}
//}
_return:
......@@ -1641,7 +1642,7 @@ int32_t ctgOpDropDbCache(SCtgCacheOperation *operation) {
goto _return;
}
if (dbCache->dbId != msg->dbId) {
if (msg->dbId && dbCache->dbId != msg->dbId) {
ctgInfo("dbId already updated, dbFName:%s, dbId:0x%" PRIx64 ", targetId:0x%" PRIx64, msg->dbFName, dbCache->dbId,
msg->dbId);
goto _return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册