Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a63b2e87
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
a63b2e87
编写于
11月 29, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-10431 remove index vars while use for synatx
上级
939c3b3a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
29 deletion
+29
-29
source/dnode/mgmt/impl/src/dndMnode.c
source/dnode/mgmt/impl/src/dndMnode.c
+6
-6
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+23
-23
未找到文件。
source/dnode/mgmt/impl/src/dndMnode.c
浏览文件 @
a63b2e87
...
...
@@ -364,13 +364,13 @@ static int32_t dndBuildMnodeOptionFromMsg(SDnode *pDnode, SMnodeOpt *pOption, SC
pOption
->
replica
=
pMsg
->
replica
;
pOption
->
selfIndex
=
-
1
;
for
(
int32_t
i
ndex
=
0
;
index
<
pMsg
->
replica
;
++
index
)
{
SReplica
*
pReplica
=
&
pOption
->
replicas
[
i
ndex
];
pReplica
->
id
=
pMsg
->
replicas
[
i
ndex
].
id
;
pReplica
->
port
=
pMsg
->
replicas
[
i
ndex
].
port
;
tstrncpy
(
pReplica
->
fqdn
,
pMsg
->
replicas
[
i
ndex
].
fqdn
,
TSDB_FQDN_LEN
);
for
(
int32_t
i
=
0
;
i
<
pMsg
->
replica
;
++
i
)
{
SReplica
*
pReplica
=
&
pOption
->
replicas
[
i
];
pReplica
->
id
=
pMsg
->
replicas
[
i
].
id
;
pReplica
->
port
=
pMsg
->
replicas
[
i
].
port
;
tstrncpy
(
pReplica
->
fqdn
,
pMsg
->
replicas
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
if
(
pReplica
->
id
==
pOption
->
dnodeId
)
{
pOption
->
selfIndex
=
i
ndex
;
pOption
->
selfIndex
=
i
;
}
}
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
a63b2e87
...
...
@@ -28,18 +28,18 @@ SSdbRaw *mndTransActionEncode(STrans *pTrans) {
int32_t
redoActionNum
=
taosArrayGetSize
(
pTrans
->
redoActions
);
int32_t
undoActionNum
=
taosArrayGetSize
(
pTrans
->
undoActions
);
for
(
int32_t
i
ndex
=
0
;
index
<
redoLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
redoLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
redoLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
redoLogs
,
i
);
rawDataLen
+=
sdbGetRawTotalSize
(
pTmp
);
}
for
(
int32_t
i
ndex
=
0
;
index
<
undoLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
undoLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
undoLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
undoLogs
,
i
);
rawDataLen
+=
sdbGetRawTotalSize
(
pTmp
);
}
for
(
int32_t
i
ndex
=
0
;
index
<
commitLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
commitLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
commitLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
commitLogs
,
i
);
rawDataLen
+=
sdbGetRawTotalSize
(
pTmp
);
}
...
...
@@ -59,22 +59,22 @@ SSdbRaw *mndTransActionEncode(STrans *pTrans) {
SDB_SET_INT32
(
pRaw
,
dataPos
,
redoActionNum
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
undoActionNum
)
for
(
int32_t
i
ndex
=
0
;
index
<
redoLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
redoLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
redoLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
redoLogs
,
i
);
int32_t
len
=
sdbGetRawTotalSize
(
pTmp
);
SDB_SET_INT32
(
pRaw
,
dataPos
,
len
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
(
void
*
)
pTmp
,
len
)
}
for
(
int32_t
i
ndex
=
0
;
index
<
undoLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
undoLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
undoLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
undoLogs
,
i
);
int32_t
len
=
sdbGetRawTotalSize
(
pTmp
);
SDB_SET_INT32
(
pRaw
,
dataPos
,
len
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
(
void
*
)
pTmp
,
len
)
}
for
(
int32_t
i
ndex
=
0
;
index
<
commitLogNum
;
++
index
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
commitLogs
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
commitLogNum
;
++
i
)
{
SSdbRaw
*
pTmp
=
taosArrayGet
(
pTrans
->
commitLogs
,
i
);
int32_t
len
=
sdbGetRawTotalSize
(
pTmp
);
SDB_SET_INT32
(
pRaw
,
dataPos
,
len
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
(
void
*
)
pTmp
,
len
)
...
...
@@ -134,7 +134,7 @@ SSdbRow *mndTransActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT32
(
pRaw
,
pRow
,
dataPos
,
&
undoActionNum
)
int32_t
code
=
0
;
for
(
int32_t
i
ndex
=
0
;
index
<
redoLogNum
;
++
index
)
{
for
(
int32_t
i
=
0
;
i
<
redoLogNum
;
++
i
)
{
int32_t
dataLen
=
0
;
SDB_GET_INT32
(
pRaw
,
pRow
,
dataPos
,
&
dataLen
)
...
...
@@ -162,8 +162,8 @@ static int32_t mndTransActionInsert(SSdb *pSdb, STrans *pTrans) {
SArray
*
pArray
=
pTrans
->
redoLogs
;
int32_t
arraySize
=
taosArrayGetSize
(
pArray
);
for
(
int32_t
i
ndex
=
0
;
index
<
arraySize
;
++
index
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
arraySize
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
);
int32_t
code
=
sdbWrite
(
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
mError
(
"trn:%d, failed to write raw:%p to sdb since %s"
,
pTrans
->
id
,
pRaw
,
terrstr
());
...
...
@@ -179,8 +179,8 @@ static int32_t mndTransActionDelete(SSdb *pSdb, STrans *pTrans) {
SArray
*
pArray
=
pTrans
->
redoLogs
;
int32_t
arraySize
=
taosArrayGetSize
(
pArray
);
for
(
int32_t
i
ndex
=
0
;
index
<
arraySize
;
++
index
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
arraySize
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
);
int32_t
code
=
sdbWrite
(
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
mError
(
"trn:%d, failed to write raw:%p to sdb since %s"
,
pTrans
->
id
,
pRaw
,
terrstr
());
...
...
@@ -197,8 +197,8 @@ static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pTrans, STrans *pDstTran
SArray
*
pArray
=
pTrans
->
redoLogs
;
int32_t
arraySize
=
taosArrayGetSize
(
pArray
);
for
(
int32_t
i
ndex
=
0
;
index
<
arraySize
;
++
index
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
arraySize
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
);
int32_t
code
=
sdbWrite
(
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
mError
(
"trn:%d, failed to write raw:%p to sdb since %s"
,
pTrans
->
id
,
pRaw
,
terrstr
());
...
...
@@ -243,8 +243,8 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, void *rpcHandle) {
}
static
void
trnDropArray
(
SArray
*
pArray
)
{
for
(
int32_t
i
ndex
=
0
;
index
<
pArray
->
size
;
++
index
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
pArray
->
size
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGet
(
pArray
,
i
);
tfree
(
pRaw
);
}
...
...
@@ -373,8 +373,8 @@ int32_t mndTransApply(SMnode *pMnode, SSdbRaw *pRaw, void *pData, int32_t code)
}
static
int32_t
trnExecuteArray
(
SMnode
*
pMnode
,
SArray
*
pArray
)
{
for
(
int32_t
i
ndex
=
0
;
index
<
pArray
->
size
;
++
index
)
{
SSdbRaw
*
pRaw
=
taosArrayGetP
(
pArray
,
i
ndex
);
for
(
int32_t
i
=
0
;
i
<
pArray
->
size
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGetP
(
pArray
,
i
);
if
(
sdbWrite
(
pMnode
->
pSdb
,
pRaw
)
!=
0
)
{
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录