Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0dea988c
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0dea988c
编写于
1月 30, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix deadlock
上级
474e2e3a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
20 deletion
+25
-20
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+11
-7
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+14
-13
未找到文件。
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
0dea988c
...
...
@@ -430,7 +430,7 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
goto
_err
;
}
if
(
oStbEntry
.
stbEntry
.
schemaTag
.
version
!
=
pReq
->
schemaTag
.
version
)
{
if
(
oStbEntry
.
stbEntry
.
schemaTag
.
version
=
=
pReq
->
schemaTag
.
version
)
{
goto
_err
;
}
...
...
@@ -456,10 +456,6 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
goto
_err
;
}
// metaStatsCacheDrop(pMeta, nStbEntry.uid);
metaULock
(
pMeta
);
// Get target schema info
SSchemaWrapper
*
pTagSchema
=
&
pReq
->
schemaTag
;
if
(
pTagSchema
->
nCols
==
1
&&
pTagSchema
->
pSchema
[
0
].
type
==
TSDB_DATA_TYPE_JSON
)
{
...
...
@@ -479,8 +475,8 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
goto
_err
;
}
for
(;;)
{
void
*
pKey
,
*
pVal
;
int
nKey
,
nVal
;
void
*
pKey
=
NULL
,
*
pVal
=
NULL
;
int
nKey
=
0
,
nVal
=
0
;
rc
=
tdbTbcNext
(
pCtbIdxc
,
&
pKey
,
&
nKey
,
&
pVal
,
&
nVal
);
if
(
rc
<
0
)
break
;
if
(((
SCtbIdxKey
*
)
pKey
)
->
suid
!=
suid
)
{
...
...
@@ -513,6 +509,14 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
tdbTbUpsert
(
pMeta
->
pTagIdx
,
pTagIdxKey
,
nTagIdxKey
,
NULL
,
0
,
pMeta
->
txn
);
metaDestroyTagIdxKey
(
pTagIdxKey
);
}
nStbEntry
.
version
=
version
;
nStbEntry
.
type
=
TSDB_SUPER_TABLE
;
nStbEntry
.
uid
=
pReq
->
suid
;
nStbEntry
.
name
=
pReq
->
name
;
nStbEntry
.
stbEntry
.
schemaRow
=
pReq
->
schemaRow
;
nStbEntry
.
stbEntry
.
schemaTag
=
pReq
->
schemaTag
;
metaWLock
(
pMeta
);
// update table.db
metaSaveToTbDb
(
pMeta
,
&
nStbEntry
);
...
...
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
0dea988c
...
...
@@ -96,6 +96,7 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
metaRsp
.
numOfColumns
=
schema
.
nCols
;
metaRsp
.
precision
=
pVnode
->
config
.
tsdbCfg
.
precision
;
metaRsp
.
sversion
=
schema
.
version
;
metaRsp
.
tversion
=
schemaTag
.
version
;
metaRsp
.
pSchemas
=
(
SSchema
*
)
taosMemoryMalloc
(
sizeof
(
SSchema
)
*
(
metaRsp
.
numOfColumns
+
metaRsp
.
numOfTags
));
memcpy
(
metaRsp
.
pSchemas
,
schema
.
pSchema
,
sizeof
(
SSchema
)
*
schema
.
nCols
);
...
...
@@ -264,26 +265,25 @@ _exit:
return
TSDB_CODE_SUCCESS
;
}
static
FORCE_INLINE
void
vnodeFreeSBatchRspMsg
(
void
*
p
)
{
static
FORCE_INLINE
void
vnodeFreeSBatchRspMsg
(
void
*
p
)
{
if
(
NULL
==
p
)
{
return
;
}
SBatchRspMsg
*
pRsp
=
(
SBatchRspMsg
*
)
p
;
SBatchRspMsg
*
pRsp
=
(
SBatchRspMsg
*
)
p
;
rpcFreeCont
(
pRsp
->
msg
);
}
int32_t
vnodeGetBatchMeta
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
)
{
int32_t
code
=
0
;
int32_t
rspSize
=
0
;
SBatchReq
batchReq
=
{
0
};
SBatchMsg
*
req
=
NULL
;
int32_t
code
=
0
;
int32_t
rspSize
=
0
;
SBatchReq
batchReq
=
{
0
};
SBatchMsg
*
req
=
NULL
;
SBatchRspMsg
rsp
=
{
0
};
SBatchRsp
batchRsp
=
{
0
};
SRpcMsg
reqMsg
=
*
pMsg
;
SRpcMsg
rspMsg
=
{
0
};
void
*
pRsp
=
NULL
;
SBatchRsp
batchRsp
=
{
0
};
SRpcMsg
reqMsg
=
*
pMsg
;
SRpcMsg
rspMsg
=
{
0
};
void
*
pRsp
=
NULL
;
if
(
tDeserializeSBatchReq
(
pMsg
->
pCont
,
pMsg
->
contLen
,
&
batchReq
))
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -291,7 +291,7 @@ int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
goto
_exit
;
}
int32_t
msgNum
=
taosArrayGetSize
(
batchReq
.
pMsgs
);
int32_t
msgNum
=
taosArrayGetSize
(
batchReq
.
pMsgs
);
if
(
msgNum
>=
MAX_META_MSG_IN_BATCH
)
{
code
=
TSDB_CODE_INVALID_MSG
;
qError
(
"too many msgs %d in vnode batch meta req"
,
msgNum
);
...
...
@@ -405,7 +405,8 @@ void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
VNODE_GET_LOAD_RESET_VALS
(
pVnode
->
statis
.
nInsert
,
pLoad
->
numOfInsertReqs
,
64
,
"nInsert"
);
VNODE_GET_LOAD_RESET_VALS
(
pVnode
->
statis
.
nInsertSuccess
,
pLoad
->
numOfInsertSuccessReqs
,
64
,
"nInsertSuccess"
);
VNODE_GET_LOAD_RESET_VALS
(
pVnode
->
statis
.
nBatchInsert
,
pLoad
->
numOfBatchInsertReqs
,
64
,
"nBatchInsert"
);
VNODE_GET_LOAD_RESET_VALS
(
pVnode
->
statis
.
nBatchInsertSuccess
,
pLoad
->
numOfBatchInsertSuccessReqs
,
64
,
"nBatchInsertSuccess"
);
VNODE_GET_LOAD_RESET_VALS
(
pVnode
->
statis
.
nBatchInsertSuccess
,
pLoad
->
numOfBatchInsertSuccessReqs
,
64
,
"nBatchInsertSuccess"
);
}
void
vnodeGetInfo
(
SVnode
*
pVnode
,
const
char
**
dbname
,
int32_t
*
vgId
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录