Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dccf33ec
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
未验证
提交
dccf33ec
编写于
10月 09, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17245 from taosdata/fix/TD-19245
fix: coverity issues
上级
e99b8a5f
28f82e3c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
+6
-3
source/dnode/mgmt/node_mgmt/src/dmProc.c
source/dnode/mgmt/node_mgmt/src/dmProc.c
+4
-3
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+2
-2
source/util/src/tuuid.c
source/util/src/tuuid.c
+2
-0
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmFile.c
浏览文件 @
dccf33ec
...
...
@@ -94,6 +94,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
pCfgs
=
taosMemoryCalloc
(
vnodesNum
,
sizeof
(
SWrapperCfg
));
if
(
pCfgs
==
NULL
)
{
dError
(
"failed to read %s since out of memory"
,
file
);
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_OVER
;
}
...
...
@@ -104,6 +105,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
cJSON
*
vgId
=
cJSON_GetObjectItem
(
vnode
,
"vgId"
);
if
(
!
vgId
||
vgId
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read %s since vgId not found"
,
file
);
taosMemoryFree
(
pCfgs
);
goto
_OVER
;
}
pCfg
->
vgId
=
vgId
->
valueint
;
...
...
@@ -112,6 +114,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
cJSON
*
dropped
=
cJSON_GetObjectItem
(
vnode
,
"dropped"
);
if
(
!
dropped
||
dropped
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read %s since dropped not found"
,
file
);
taosMemoryFree
(
pCfgs
);
goto
_OVER
;
}
pCfg
->
dropped
=
dropped
->
valueint
;
...
...
@@ -119,6 +122,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t
cJSON
*
vgVersion
=
cJSON_GetObjectItem
(
vnode
,
"vgVersion"
);
if
(
!
vgVersion
||
vgVersion
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read %s since vgVersion not found"
,
file
);
taosMemoryFree
(
pCfgs
);
goto
_OVER
;
}
pCfg
->
vgVersion
=
vgVersion
->
valueint
;
...
...
@@ -135,7 +139,6 @@ _OVER:
if
(
content
!=
NULL
)
taosMemoryFree
(
content
);
if
(
root
!=
NULL
)
cJSON_Delete
(
root
);
if
(
pFile
!=
NULL
)
taosCloseFile
(
&
pFile
);
if
(
code
!=
0
)
taosMemoryFree
(
pCfgs
);
terrno
=
code
;
return
code
;
...
...
@@ -143,8 +146,8 @@ _OVER:
int32_t
vmWriteVnodeListToFile
(
SVnodeMgmt
*
pMgmt
)
{
int32_t
ret
=
0
;
char
file
[
PATH_MAX
]
=
{
0
};
char
realfile
[
PATH_MAX
]
=
{
0
};
char
file
[
PATH_MAX
]
=
{
0
};
char
realfile
[
PATH_MAX
]
=
{
0
};
snprintf
(
file
,
sizeof
(
file
),
"%s%svnodes.json.bak"
,
pMgmt
->
path
,
TD_DIRSEP
);
snprintf
(
realfile
,
sizeof
(
file
),
"%s%svnodes.json"
,
pMgmt
->
path
,
TD_DIRSEP
);
...
...
source/dnode/mgmt/node_mgmt/src/dmProc.c
浏览文件 @
dccf33ec
...
...
@@ -65,6 +65,7 @@ static SProcQueue *dmInitProcQueue(SProc *proc, char *ptr, int32_t size) {
}
if
(
proc
->
ptype
&
DND_PROC_PARENT
)
{
memset
(
ptr
,
0
,
sizeof
(
SProcQueue
));
if
(
dmInitProcMutex
(
queue
)
!=
0
)
{
return
NULL
;
}
...
...
@@ -76,11 +77,11 @@ static SProcQueue *dmInitProcQueue(SProc *proc, char *ptr, int32_t size) {
tstrncpy
(
queue
->
name
,
proc
->
name
,
sizeof
(
queue
->
name
));
taosThreadMutexLock
(
&
queue
->
mutex
);
queue
->
head
=
0
;
queue
->
tail
=
0
;
//
queue->head = 0;
//
queue->tail = 0;
queue
->
total
=
bufSize
;
queue
->
avail
=
bufSize
;
queue
->
items
=
0
;
//
queue->items = 0;
taosThreadMutexUnlock
(
&
queue
->
mutex
);
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
dccf33ec
...
...
@@ -103,7 +103,7 @@ static int32_t mndCreateDefaultDnode(SMnode *pMnode) {
dnodeObj
.
port
=
tsServerPort
;
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
.
p
ort
);
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
tsLocalFqdn
,
tsServerP
ort
);
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_RETRY
,
TRN_CONFLICT_GLOBAL
,
NULL
,
"create-dnode"
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
...
...
@@ -490,7 +490,7 @@ static int32_t mndCreateDnode(SMnode *pMnode, SRpcMsg *pReq, SCreateDnodeReq *pC
dnodeObj
.
updateTime
=
dnodeObj
.
createdTime
;
dnodeObj
.
port
=
pCreate
->
port
;
tstrncpy
(
dnodeObj
.
fqdn
,
pCreate
->
fqdn
,
TSDB_FQDN_LEN
);
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
dnodeObj
.
fqdn
,
dnodeObj
.
port
);
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
-
1
,
"%s:%u"
,
pCreate
->
fqdn
,
pCreate
->
port
);
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_GLOBAL
,
pReq
,
"create-dnode"
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
...
...
source/util/src/tuuid.c
浏览文件 @
dccf33ec
...
...
@@ -22,6 +22,8 @@ int32_t tGenIdPI32(void) {
if
(
tUUIDHashId
==
0
)
{
char
uid
[
65
]
=
{
0
};
int32_t
code
=
taosGetSystemUUID
(
uid
,
sizeof
(
uid
));
uid
[
64
]
=
0
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录