Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6a1ec694
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6a1ec694
编写于
11月 25, 2022
作者:
D
dapan1121
提交者:
GitHub
11月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18398 from taosdata/fix/TS-2139
fix: query failed issue caused of db dropped
上级
397a92ee
724038b4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
25 deletion
+44
-25
source/client/src/clientHb.c
source/client/src/clientHb.c
+10
-5
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+12
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+15
-17
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+3
-0
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+4
-3
未找到文件。
source/client/src/clientHb.c
浏览文件 @
6a1ec694
...
...
@@ -69,7 +69,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
}
else
{
SDBVgInfo
*
vgInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SDBVgInfo
));
if
(
NULL
==
vgInfo
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
goto
_return
;
}
vgInfo
->
vgVersion
=
rsp
->
vgVersion
;
...
...
@@ -81,7 +82,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
if
(
NULL
==
vgInfo
->
vgHash
)
{
taosMemoryFree
(
vgInfo
);
tscError
(
"hash init[%d] failed"
,
rsp
->
vgNum
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
goto
_return
;
}
for
(
int32_t
j
=
0
;
j
<
rsp
->
vgNum
;
++
j
)
{
...
...
@@ -90,7 +92,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
tscError
(
"hash push failed, errno:%d"
,
errno
);
taosHashCleanup
(
vgInfo
->
vgHash
);
taosMemoryFree
(
vgInfo
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
goto
_return
;
}
}
...
...
@@ -98,12 +101,14 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
}
if
(
code
)
{
return
code
;
goto
_return
;
}
}
_return:
tFreeSUseDbBatchRsp
(
&
batchUseRsp
);
return
TSDB_CODE_SUCCESS
;
return
code
;
}
static
int32_t
hbProcessStbInfoRsp
(
void
*
value
,
int32_t
valueLen
,
struct
SCatalog
*
pCatalog
)
{
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
6a1ec694
...
...
@@ -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,17 @@ 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
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SRequestConnInfo
conn
=
{.
pTrans
=
pTscObj
->
pAppInfo
->
pTransporter
,
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
char
dbFName
[
TSDB_DB_FNAME_LEN
];
snprintf
(
dbFName
,
sizeof
(
dbFName
)
-
1
,
"%d.%s"
,
pTscObj
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
);
catalogRefreshDBVgInfo
(
pCatalog
,
&
conn
,
dbFName
);
snprintf
(
dbFName
,
sizeof
(
dbFName
)
-
1
,
"%d.%s"
,
pTscObj
->
acctId
,
TSDB_PERFORMANCE_SCHEMA_DB
);
catalogRefreshDBVgInfo
(
pCatalog
,
&
conn
,
dbFName
);
}
}
...
...
source/common/src/tmsg.c
浏览文件 @
6a1ec694
...
...
@@ -2537,24 +2537,22 @@ int32_t tDeserializeSUseDbRspImp(SDecoder *pDecoder, SUseDbRsp *pRsp) {
if
(
tDecodeI16
(
pDecoder
,
&
pRsp
->
hashSuffix
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pRsp
->
hashMethod
)
<
0
)
return
-
1
;
if
(
pRsp
->
vgNum
<=
0
)
{
return
0
;
}
pRsp
->
pVgroupInfos
=
taosArrayInit
(
pRsp
->
vgNum
,
sizeof
(
SVgroupInfo
));
if
(
pRsp
->
pVgroupInfos
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
if
(
pRsp
->
vgNum
>
0
)
{
pRsp
->
pVgroupInfos
=
taosArrayInit
(
pRsp
->
vgNum
,
sizeof
(
SVgroupInfo
));
if
(
pRsp
->
pVgroupInfos
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
for
(
int32_t
i
=
0
;
i
<
pRsp
->
vgNum
;
++
i
)
{
SVgroupInfo
vgInfo
=
{
0
};
if
(
tDecodeI32
(
pDecoder
,
&
vgInfo
.
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
pDecoder
,
&
vgInfo
.
hashBegin
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
pDecoder
,
&
vgInfo
.
hashEnd
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
pDecoder
,
&
vgInfo
.
epSet
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
vgInfo
.
numOfTable
)
<
0
)
return
-
1
;
taosArrayPush
(
pRsp
->
pVgroupInfos
,
&
vgInfo
);
for
(
int32_t
i
=
0
;
i
<
pRsp
->
vgNum
;
++
i
)
{
SVgroupInfo
vgInfo
=
{
0
};
if
(
tDecodeI32
(
pDecoder
,
&
vgInfo
.
vgId
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
pDecoder
,
&
vgInfo
.
hashBegin
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
pDecoder
,
&
vgInfo
.
hashEnd
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
pDecoder
,
&
vgInfo
.
epSet
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
vgInfo
.
numOfTable
)
<
0
)
return
-
1
;
taosArrayPush
(
pRsp
->
pVgroupInfos
,
&
vgInfo
);
}
}
if
(
tDecodeI32
(
pDecoder
,
&
pRsp
->
errCode
)
<
0
)
return
-
1
;
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
6a1ec694
...
...
@@ -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
));
}
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
6a1ec694
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录