Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
58f2626e
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1183
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
58f2626e
编写于
10月 08, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17206 from taosdata/fix/TD-19245
fix: coverity issues
上级
10731f97
69252914
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
66 addition
and
55 deletion
+66
-55
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
+6
-1
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+1
-1
source/dnode/mnode/impl/src/mndAcct.c
source/dnode/mnode/impl/src/mndAcct.c
+1
-1
source/dnode/mnode/impl/src/mndCluster.c
source/dnode/mnode/impl/src/mndCluster.c
+3
-3
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+5
-5
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+12
-8
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+3
-3
source/dnode/mnode/impl/src/mndOffset.c
source/dnode/mnode/impl/src/mndOffset.c
+2
-2
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+3
-3
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+3
-3
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+5
-3
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+5
-5
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+8
-8
source/dnode/mnode/sdb/src/sdbFile.c
source/dnode/mnode/sdb/src/sdbFile.c
+1
-1
source/util/src/tuuid.c
source/util/src/tuuid.c
+2
-2
utils/tsim/src/simExe.c
utils/tsim/src/simExe.c
+6
-6
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
浏览文件 @
58f2626e
...
...
@@ -135,7 +135,7 @@ _OVER:
if
(
content
!=
NULL
)
taosMemoryFree
(
content
);
if
(
root
!=
NULL
)
cJSON_Delete
(
root
);
if
(
pFile
!=
NULL
)
taosCloseFile
(
&
pFile
);
if
(
*
ppCfgs
==
NULL
&&
pCfgs
!=
NULL
)
taosMemoryFree
(
pCfgs
);
if
(
code
!=
0
)
taosMemoryFree
(
pCfgs
);
terrno
=
code
;
return
code
;
...
...
@@ -157,6 +157,11 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
int32_t
numOfVnodes
=
0
;
SVnodeObj
**
pVnodes
=
vmGetVnodeListFromHash
(
pMgmt
,
&
numOfVnodes
);
if
(
pVnodes
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
ret
=
-
1
;
goto
_OVER
;
}
int32_t
len
=
0
;
int32_t
maxLen
=
MAX_CONTENT_LEN
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
58f2626e
...
...
@@ -384,7 +384,7 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) {
for
(
int32_t
v
=
0
;
v
<
numOfVnodes
;
++
v
)
{
int32_t
t
=
v
%
threadNum
;
SVnodeThread
*
pThread
=
&
threads
[
t
];
if
(
pThread
->
ppVnodes
!=
NULL
)
{
if
(
pThread
->
ppVnodes
!=
NULL
&&
ppVnodes
!=
NULL
)
{
pThread
->
ppVnodes
[
pThread
->
vnodeNum
++
]
=
ppVnodes
[
v
];
}
}
...
...
source/dnode/mnode/impl/src/mndAcct.c
浏览文件 @
58f2626e
...
...
@@ -77,7 +77,7 @@ static int32_t mndCreateDefaultAcct(SMnode *pMnode) {
SSdbRaw
*
pRaw
=
mndAcctActionEncode
(
&
acctObj
);
if
(
pRaw
==
NULL
)
return
-
1
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
mInfo
(
"acct:%s, will be created when deploying, raw:%p"
,
acctObj
.
acct
,
pRaw
);
...
...
source/dnode/mnode/impl/src/mndCluster.c
浏览文件 @
58f2626e
...
...
@@ -231,7 +231,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
SSdbRaw
*
pRaw
=
mndClusterActionEncode
(
&
clusterObj
);
if
(
pRaw
==
NULL
)
return
-
1
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
mInfo
(
"cluster:%"
PRId64
", will be created when deploying, raw:%p"
,
clusterObj
.
id
,
pRaw
);
...
...
@@ -248,7 +248,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) {
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -326,7 +326,7 @@ static int32_t mndProcessUptimeTimer(SRpcMsg *pReq) {
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
58f2626e
...
...
@@ -730,7 +730,7 @@ static int32_t mndSetAlterDbRedoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pOl
return
-
1
;
}
sdbSetRawStatus
(
pRedoRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRedoRaw
,
SDB_STATUS_READY
);
return
0
;
}
...
...
@@ -742,7 +742,7 @@ static int32_t mndSetAlterDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *p
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
return
0
;
}
...
...
@@ -938,7 +938,7 @@ static int32_t mndSetDropDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD
sdbRelease
(
pSdb
,
pVgroup
);
return
-
1
;
}
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_DROPPED
);
}
sdbRelease
(
pSdb
,
pVgroup
);
...
...
@@ -956,7 +956,7 @@ static int32_t mndSetDropDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD
sdbRelease
(
pSdb
,
pStbRaw
);
return
-
1
;
}
sdbSetRawStatus
(
pStbRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pStbRaw
,
SDB_STATUS_DROPPED
);
}
sdbRelease
(
pSdb
,
pStb
);
...
...
@@ -1052,7 +1052,7 @@ static int32_t mndDropDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb) {
mError
(
"trans:%d, failed to append redo log since %s"
,
pTrans
->
id
,
terrstr
());
goto
_OVER
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
}
int32_t
rspLen
=
0
;
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
58f2626e
...
...
@@ -101,7 +101,8 @@ static int32_t mndCreateDefaultDnode(SMnode *pMnode) {
dnodeObj
.
createdTime
=
taosGetTimestampMs
();
dnodeObj
.
updateTime
=
dnodeObj
.
createdTime
;
dnodeObj
.
port
=
tsServerPort
;
memcpy
(
&
dnodeObj
.
fqdn
,
tsLocalFqdn
,
TSDB_FQDN_LEN
);
tstrncpy
(
dnodeObj
.
fqdn
,
tsLocalFqdn
,
TSDB_FQDN_LEN
);
dnodeObj
.
fqdn
[
TSDB_FQDN_LEN
-
1
]
=
0
;
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
dnodeObj
.
fqdn
,
dnodeObj
.
port
);
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_GLOBAL
,
NULL
,
"create-dnode"
);
...
...
@@ -110,7 +111,7 @@ static int32_t mndCreateDefaultDnode(SMnode *pMnode) {
pRaw
=
mndDnodeActionEncode
(
&
dnodeObj
);
if
(
pRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
...
@@ -190,7 +191,10 @@ _OVER:
static
int32_t
mndDnodeActionInsert
(
SSdb
*
pSdb
,
SDnodeObj
*
pDnode
)
{
mTrace
(
"dnode:%d, perform insert action, row:%p"
,
pDnode
->
id
,
pDnode
);
pDnode
->
offlineReason
=
DND_REASON_STATUS_NOT_RECEIVED
;
snprintf
(
pDnode
->
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
pDnode
->
fqdn
,
pDnode
->
port
);
char
ep
[
TSDB_EP_LEN
]
=
{
0
};
snprintf
(
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
pDnode
->
fqdn
,
pDnode
->
port
);
tstrncpy
(
pDnode
->
ep
,
ep
,
TSDB_EP_LEN
);
return
0
;
}
...
...
@@ -275,7 +279,7 @@ void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps) {
SDnodeEp
dnodeEp
=
{
0
};
dnodeEp
.
id
=
pDnode
->
id
;
dnodeEp
.
ep
.
port
=
pDnode
->
port
;
mem
cpy
(
dnodeEp
.
ep
.
fqdn
,
pDnode
->
fqdn
,
TSDB_FQDN_LEN
);
tstrn
cpy
(
dnodeEp
.
ep
.
fqdn
,
pDnode
->
fqdn
,
TSDB_FQDN_LEN
);
sdbRelease
(
pSdb
,
pDnode
);
dnodeEp
.
isMnode
=
0
;
...
...
@@ -485,7 +489,7 @@ static int32_t mndCreateDnode(SMnode *pMnode, SRpcMsg *pReq, SCreateDnodeReq *pC
dnodeObj
.
createdTime
=
taosGetTimestampMs
();
dnodeObj
.
updateTime
=
dnodeObj
.
createdTime
;
dnodeObj
.
port
=
pCreate
->
port
;
mem
cpy
(
dnodeObj
.
fqdn
,
pCreate
->
fqdn
,
TSDB_FQDN_LEN
);
tstrn
cpy
(
dnodeObj
.
fqdn
,
pCreate
->
fqdn
,
TSDB_FQDN_LEN
);
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
dnodeObj
.
fqdn
,
dnodeObj
.
port
);
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_GLOBAL
,
pReq
,
"create-dnode"
);
...
...
@@ -494,7 +498,7 @@ static int32_t mndCreateDnode(SMnode *pMnode, SRpcMsg *pReq, SCreateDnodeReq *pC
pRaw
=
mndDnodeActionEncode
(
&
dnodeObj
);
if
(
pRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
...
@@ -675,13 +679,13 @@ static int32_t mndDropDnode(SMnode *pMnode, SRpcMsg *pReq, SDnodeObj *pDnode, SM
pRaw
=
mndDnodeActionEncode
(
pDnode
);
if
(
pRaw
==
NULL
)
goto
_OVER
;
if
(
mndTransAppendRedolog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPING
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPING
);
pRaw
=
NULL
;
pRaw
=
mndDnodeActionEncode
(
pDnode
);
if
(
pRaw
==
NULL
)
goto
_OVER
;
if
(
mndTransAppendCommitlog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPED
);
pRaw
=
NULL
;
if
(
pMObj
!=
NULL
)
{
...
...
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
58f2626e
...
...
@@ -259,17 +259,17 @@ static int32_t mndDropFunc(SMnode *pMnode, SRpcMsg *pReq, SFuncObj *pFunc) {
SSdbRaw
*
pRedoRaw
=
mndFuncActionEncode
(
pFunc
);
if
(
pRedoRaw
==
NULL
)
goto
_OVER
;
if
(
mndTransAppendRedolog
(
pTrans
,
pRedoRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRedoRaw
,
SDB_STATUS_DROPPING
);
(
void
)
sdbSetRawStatus
(
pRedoRaw
,
SDB_STATUS_DROPPING
);
SSdbRaw
*
pUndoRaw
=
mndFuncActionEncode
(
pFunc
);
if
(
pUndoRaw
==
NULL
)
goto
_OVER
;
if
(
mndTransAppendUndolog
(
pTrans
,
pUndoRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pUndoRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pUndoRaw
,
SDB_STATUS_READY
);
SSdbRaw
*
pCommitRaw
=
mndFuncActionEncode
(
pFunc
);
if
(
pCommitRaw
==
NULL
)
goto
_OVER
;
if
(
mndTransAppendCommitlog
(
pTrans
,
pCommitRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
...
...
source/dnode/mnode/impl/src/mndOffset.c
浏览文件 @
58f2626e
...
...
@@ -161,7 +161,7 @@ int32_t mndCreateOffsets(STrans *pTrans, const char *cgroup, const char *topicNa
if
(
pOffsetRaw
==
NULL
)
{
return
-
1
;
}
sdbSetRawStatus
(
pOffsetRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pOffsetRaw
,
SDB_STATUS_READY
);
// commit log or redo log?
if
(
mndTransAppendRedolog
(
pTrans
,
pOffsetRaw
)
<
0
)
{
return
-
1
;
...
...
@@ -208,7 +208,7 @@ static int32_t mndProcessCommitOffsetReq(SRpcMsg *pMsg) {
}
pOffsetObj
->
offset
=
pOffset
->
offset
;
SSdbRaw
*
pOffsetRaw
=
mndOffsetActionEncode
(
pOffsetObj
);
sdbSetRawStatus
(
pOffsetRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pOffsetRaw
,
SDB_STATUS_READY
);
mndTransAppendCommitlog
(
pTrans
,
pOffsetRaw
);
if
(
create
)
{
taosMemoryFree
(
pOffsetObj
);
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
58f2626e
...
...
@@ -406,7 +406,7 @@ int32_t mndPersistStream(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream) {
mError
(
"trans:%d, failed to append commit log since %s"
,
pTrans
->
id
,
terrstr
());
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
return
0
;
}
...
...
@@ -417,7 +417,7 @@ int32_t mndPersistDropStreamLog(SMnode *pMnode, STrans *pTrans, SStreamObj *pStr
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
return
0
;
}
...
...
@@ -433,7 +433,7 @@ static int32_t mndSetStreamRecover(SMnode *pMnode, STrans *pTrans, const SStream
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
58f2626e
...
...
@@ -459,7 +459,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
if
(
topicObj
.
ntbUid
!=
0
)
{
STqCheckInfo
info
;
...
...
@@ -596,7 +596,7 @@ static int32_t mndDropTopic(SMnode *pMnode, STrans *pTrans, SRpcMsg *pReq, SMqTo
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -777,7 +777,7 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
int32_t
cols
=
0
;
char
topicName
[
TSDB_TOPIC_NAME_LEN
+
VARSTR_HEADER_SIZE
+
5
]
=
{
0
};
strcpy
(
varDataVal
(
topicName
),
mndGetDbStr
(
pTopic
->
name
)
);
tstrncpy
(
varDataVal
(
topicName
),
mndGetDbStr
(
pTopic
->
name
),
sizeof
(
topicName
)
-
2
);
/*tNameFromString(&n, pTopic->name, T_NAME_ACCT | T_NAME_DB);*/
/*tNameGetDbName(&n, varDataVal(topicName));*/
varDataSetLen
(
topicName
,
strlen
(
varDataVal
(
topicName
)));
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
58f2626e
...
...
@@ -435,7 +435,9 @@ _OVER:
return
NULL
;
}
if
(
pTrans
!=
NULL
)
{
mTrace
(
"trans:%d, decode from raw:%p, row:%p"
,
pTrans
->
id
,
pRaw
,
pTrans
);
}
return
pRow
;
}
...
...
@@ -769,7 +771,7 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
mError
(
"trans:%d, failed to encode while sync trans since %s"
,
pTrans
->
id
,
terrstr
());
return
-
1
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
mInfo
(
"trans:%d, sync to other mnodes, stage:%s"
,
pTrans
->
id
,
mndTransStr
(
pTrans
->
stage
));
int32_t
code
=
mndSyncPropose
(
pMnode
,
pRaw
,
pTrans
->
id
);
...
...
@@ -1431,7 +1433,7 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
mError
(
"trans:%d, failed to encode while finish trans since %s"
,
pTrans
->
id
,
terrstr
());
return
false
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_DROPPED
);
int32_t
code
=
sdbWrite
(
pMnode
->
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
58f2626e
...
...
@@ -77,7 +77,7 @@ static int32_t mndCreateDefaultUser(SMnode *pMnode, char *acct, char *user, char
SSdbRaw
*
pRaw
=
mndUserActionEncode
(
&
userObj
);
if
(
pRaw
==
NULL
)
return
-
1
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
mInfo
(
"user:%s, will be created when deploying, raw:%p"
,
userObj
.
user
,
pRaw
);
...
...
@@ -94,7 +94,7 @@ static int32_t mndCreateDefaultUser(SMnode *pMnode, char *acct, char *user, char
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -313,7 +313,7 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -397,7 +397,7 @@ static int32_t mndAlterUser(SMnode *pMnode, SUserObj *pOld, SUserObj *pNew, SRpc
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_READY
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -612,7 +612,7 @@ static int32_t mndDropUser(SMnode *pMnode, SRpcMsg *pReq, SUserObj *pUser) {
mndTransDrop
(
pTrans
);
return
-
1
;
}
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
(
void
)
sdbSetRawStatus
(
pCommitRaw
,
SDB_STATUS_DROPPED
);
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
{
mError
(
"trans:%d, failed to prepare since %s"
,
pTrans
->
id
,
terrstr
());
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
58f2626e
...
...
@@ -1115,14 +1115,14 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
{
SSdbRaw
*
pRaw
=
mndVgroupActionEncode
(
&
newVg
);
if
(
pRaw
==
NULL
||
mndTransAppendRedolog
(
pTrans
,
pRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
}
{
SSdbRaw
*
pRaw
=
mndVgroupActionEncode
(
&
newVg
);
if
(
pRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
}
...
...
@@ -1304,14 +1304,14 @@ static int32_t mndRedistributeVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb,
{
pRaw
=
mndVgroupActionEncode
(
&
newVg
);
if
(
pRaw
==
NULL
||
mndTransAppendRedolog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
}
{
pRaw
=
mndVgroupActionEncode
(
&
newVg
);
if
(
pRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pRaw
)
!=
0
)
goto
_OVER
;
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
pRaw
=
NULL
;
}
...
...
@@ -1579,7 +1579,7 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, S
sdbFreeRaw
(
pVgRaw
);
return
-
1
;
}
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
);
}
{
...
...
@@ -1589,7 +1589,7 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, S
sdbFreeRaw
(
pVgRaw
);
return
-
1
;
}
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
);
}
}
...
...
@@ -1704,7 +1704,7 @@ static int32_t mndSetBalanceVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SD
sdbFreeRaw
(
pRaw
);
return
-
1
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
}
{
...
...
@@ -1713,7 +1713,7 @@ static int32_t mndSetBalanceVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SD
sdbFreeRaw
(
pRaw
);
return
-
1
;
}
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
}
mInfo
(
"vgId:%d, vgroup info after balance, replica:%d"
,
newVg
.
vgId
,
newVg
.
replica
);
...
...
source/dnode/mnode/sdb/src/sdbFile.c
浏览文件 @
58f2626e
...
...
@@ -619,8 +619,8 @@ int32_t sdbStopWrite(SSdb *pSdb, SSdbIter *pIter, bool isApply, int64_t index, i
int32_t
code
=
0
;
if
(
!
isApply
)
{
sdbCloseIter
(
pIter
);
mInfo
(
"sdbiter:%p, not apply to sdb"
,
pIter
);
sdbCloseIter
(
pIter
);
return
0
;
}
...
...
source/util/src/tuuid.c
浏览文件 @
58f2626e
...
...
@@ -39,8 +39,8 @@ int32_t tGenIdPI32(void) {
int64_t
tGenIdPI64
(
void
)
{
if
(
tUUIDHashId
==
0
)
{
char
uid
[
6
4
]
;
int32_t
code
=
taosGetSystemUUID
(
uid
,
tListLen
(
uid
)
);
char
uid
[
6
5
]
=
{
0
}
;
int32_t
code
=
taosGetSystemUUID
(
uid
,
64
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
}
else
{
...
...
utils/tsim/src/simExe.c
浏览文件 @
58f2626e
...
...
@@ -237,9 +237,9 @@ int32_t simExecuteExpression(SScript *script, char *exp) {
int32_t
var3Len
=
0
;
int32_t
val0
=
0
;
int32_t
val1
=
0
;
char
t0
[
1024
]
=
{
0
};
char
t1
[
1024
]
=
{
0
};
char
t2
[
1024
]
=
{
0
};
char
t0
[
2048
]
=
{
0
};
char
t1
[
2048
]
=
{
0
};
char
t2
[
2048
]
=
{
0
};
char
t3
[
2048
]
=
{
0
};
int32_t
result
=
0
;
...
...
@@ -256,7 +256,7 @@ int32_t simExecuteExpression(SScript *script, char *exp) {
}
if
(
var2
[
0
]
==
'$'
)
{
tstrncpy
(
t1
,
simGetVariable
(
script
,
var2
+
1
,
var2Len
-
1
),
1024
);
tstrncpy
(
t1
,
simGetVariable
(
script
,
var2
+
1
,
var2Len
-
1
),
sizeof
(
t1
)
);
}
else
{
memcpy
(
t1
,
var2
,
var2Len
);
t1
[
var2Len
]
=
0
;
...
...
@@ -266,7 +266,7 @@ int32_t simExecuteExpression(SScript *script, char *exp) {
rest
=
paGetToken
(
rest
,
&
var3
,
&
var3Len
);
if
(
var3
[
0
]
==
'$'
)
strcpy
(
t2
,
simGetVariable
(
script
,
var3
+
1
,
var3Len
-
1
));
tstrncpy
(
t2
,
simGetVariable
(
script
,
var3
+
1
,
var3Len
-
1
),
sizeof
(
t2
));
else
{
memcpy
(
t2
,
var3
,
var3Len
);
t2
[
var3Len
]
=
0
;
...
...
@@ -291,7 +291,7 @@ int32_t simExecuteExpression(SScript *script, char *exp) {
sprintf
(
t3
,
"%s%s"
,
t1
,
t2
);
}
}
else
{
strcpy
(
t3
,
t1
);
tstrncpy
(
t3
,
t1
,
sizeof
(
t3
)
);
}
result
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录