Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0d57a4be
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
0d57a4be
编写于
11月 26, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-11265 invalid write in dnode.c
上级
b6c28a49
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
30 deletion
+30
-30
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+4
-4
include/dnode/vnode/vnode.h
include/dnode/vnode/vnode.h
+4
-4
source/dnode/mgmt/daemon/src/daemon.c
source/dnode/mgmt/daemon/src/daemon.c
+6
-6
source/dnode/mgmt/impl/inc/dndDnode.h
source/dnode/mgmt/impl/inc/dndDnode.h
+9
-9
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+1
-1
source/dnode/mgmt/impl/src/dnode.c
source/dnode/mgmt/impl/src/dnode.c
+4
-4
source/dnode/mnode/impl/inc/mnodeDef.h
source/dnode/mnode/impl/inc/mnodeDef.h
+2
-2
未找到文件。
include/dnode/mnode/mnode.h
浏览文件 @
0d57a4be
...
...
@@ -24,10 +24,10 @@ extern "C" {
typedef
struct
SDnode
SDnode
;
typedef
struct
SMnode
SMnode
;
typedef
struct
SMnodeMsg
SMnodeMsg
;
typedef
void
(
*
SendMsgToDnodeFp
)(
SDnode
*
pDn
d
,
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendMsgToMnodeFp
)(
SDnode
*
pDn
d
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendRedirectMsgFp
)(
SDnode
*
pDn
d
,
struct
SRpcMsg
*
rpcMsg
);
typedef
int32_t
(
*
PutMsgToMnodeQFp
)(
SDnode
*
pDn
d
,
SMnodeMsg
*
pMsg
);
typedef
void
(
*
SendMsgToDnodeFp
)(
SDnode
*
pDn
ode
,
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendMsgToMnodeFp
)(
SDnode
*
pDn
ode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendRedirectMsgFp
)(
SDnode
*
pDn
ode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
int32_t
(
*
PutMsgToMnodeQFp
)(
SDnode
*
pDn
ode
,
SMnodeMsg
*
pMsg
);
typedef
struct
SMnodeLoad
{
int64_t
numOfDnode
;
...
...
include/dnode/vnode/vnode.h
浏览文件 @
0d57a4be
...
...
@@ -185,10 +185,10 @@ typedef struct {
}
SVnodeMsg
;
typedef
struct
SDnode
SDnode
;
typedef
void
(
*
SendMsgToDnodeFp
)(
SDnode
*
pDn
d
,
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendMsgToMnodeFp
)(
SDnode
*
pDn
d
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendRedirectMsgFp
)(
SDnode
*
pDn
d
,
struct
SRpcMsg
*
rpcMsg
);
typedef
int32_t
(
*
PutMsgToVnodeQFp
)(
SDnode
*
pDn
d
,
int32_t
vgId
,
SVnodeMsg
*
pMsg
);
typedef
void
(
*
SendMsgToDnodeFp
)(
SDnode
*
pDn
ode
,
struct
SEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendMsgToMnodeFp
)(
SDnode
*
pDn
ode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
void
(
*
SendRedirectMsgFp
)(
SDnode
*
pDn
ode
,
struct
SRpcMsg
*
rpcMsg
);
typedef
int32_t
(
*
PutMsgToVnodeQFp
)(
SDnode
*
pDn
ode
,
int32_t
vgId
,
SVnodeMsg
*
pMsg
);
typedef
struct
{
PutMsgToVnodeQFp
putMsgToApplyQueueFp
;
...
...
source/dnode/mgmt/daemon/src/daemon.c
浏览文件 @
0d57a4be
...
...
@@ -141,13 +141,13 @@ void dmnInitOption(SDnodeOpt *pOption) {
pOption
->
shellActivityTimer
=
tsShellActivityTimer
;
pOption
->
statusInterval
=
tsStatusInterval
;
pOption
->
serverPort
=
tsServerPort
;
tstrncpy
(
pOption
->
dataDir
,
tsDataDir
,
TSDB_EP_LEN
);
tstrncpy
(
pOption
->
dataDir
,
tsDataDir
,
PATH_MAX
);
tstrncpy
(
pOption
->
localEp
,
tsLocalEp
,
TSDB_EP_LEN
);
tstrncpy
(
pOption
->
localFqdn
,
tsLocal
Ep
,
TSDB_FQDN_LEN
);
tstrncpy
(
pOption
->
firstEp
,
tsFirst
,
TSDB_
FQDN
_LEN
);
tstrncpy
(
pOption
->
timezone
,
ts
LocalEp
,
TSDB_TIMEZONE_LEN
);
tstrncpy
(
pOption
->
locale
,
tsLocal
Ep
,
TSDB_LOCALE_LEN
);
tstrncpy
(
pOption
->
charset
,
ts
LocalEp
,
TSDB_LOCALE_LEN
);
tstrncpy
(
pOption
->
localFqdn
,
tsLocal
Fqdn
,
TSDB_FQDN_LEN
);
tstrncpy
(
pOption
->
firstEp
,
tsFirst
,
TSDB_
EP
_LEN
);
tstrncpy
(
pOption
->
timezone
,
ts
Timezone
,
TSDB_TIMEZONE_LEN
);
tstrncpy
(
pOption
->
locale
,
tsLocal
e
,
TSDB_LOCALE_LEN
);
tstrncpy
(
pOption
->
charset
,
ts
Charset
,
TSDB_LOCALE_LEN
);
}
int
dmnRunDnode
()
{
...
...
source/dnode/mgmt/impl/inc/dndDnode.h
浏览文件 @
0d57a4be
...
...
@@ -21,16 +21,16 @@ extern "C" {
#endif
#include "dndInt.h"
int32_t
dndInitDnode
(
SDnode
*
pDn
d
);
void
dndCleanupDnode
(
SDnode
*
pDn
d
);
void
dndProcessDnodeReq
(
SDnode
*
pDn
d
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
void
dndProcessDnodeRsp
(
SDnode
*
pDn
d
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
dndInitDnode
(
SDnode
*
pDn
ode
);
void
dndCleanupDnode
(
SDnode
*
pDn
ode
);
void
dndProcessDnodeReq
(
SDnode
*
pDn
ode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
void
dndProcessDnodeRsp
(
SDnode
*
pDn
ode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
);
int32_t
dndGetDnodeId
(
SDnode
*
pDn
d
);
int64_t
dndGetClusterId
(
SDnode
*
pDn
d
);
void
dndGetDnodeEp
(
SDnode
*
pDn
d
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dndGetMnodeEpSet
(
SDnode
*
pDn
d
,
SEpSet
*
pEpSet
);
void
dndSendRedirectMsg
(
SDnode
*
pDn
d
,
SRpcMsg
*
pMsg
);
int32_t
dndGetDnodeId
(
SDnode
*
pDn
ode
);
int64_t
dndGetClusterId
(
SDnode
*
pDn
ode
);
void
dndGetDnodeEp
(
SDnode
*
pDn
ode
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dndGetMnodeEpSet
(
SDnode
*
pDn
ode
,
SEpSet
*
pEpSet
);
void
dndSendRedirectMsg
(
SDnode
*
pDn
ode
,
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
0d57a4be
...
...
@@ -480,7 +480,7 @@ int32_t dndInitDnode(SDnode *pDnode) {
return
-
1
;
}
pMgmt
->
dnodeHash
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_
ENTRY
_LOCK
);
pMgmt
->
dnodeHash
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_
NO
_LOCK
);
if
(
pMgmt
->
dnodeHash
==
NULL
)
{
dError
(
"failed to init dnode hash"
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mgmt/impl/src/dnode.c
浏览文件 @
0d57a4be
...
...
@@ -84,13 +84,13 @@ static int32_t dndInitEnv(SDnode *pDnode, SDnodeOpt *pOptions) {
char
path
[
PATH_MAX
+
100
];
snprintf
(
path
,
sizeof
(
path
),
"%s%smnode"
,
pOptions
->
dataDir
,
TD_DIRSEP
);
pDnode
->
dir
.
mnode
=
strdup
(
path
);
pDnode
->
dir
.
mnode
=
t
strdup
(
path
);
snprintf
(
path
,
sizeof
(
path
),
"%s%svnode"
,
pOptions
->
dataDir
,
TD_DIRSEP
);
pDnode
->
dir
.
vnodes
=
strdup
(
path
);
pDnode
->
dir
.
vnodes
=
t
strdup
(
path
);
snprintf
(
path
,
sizeof
(
path
),
"%s%sdnode"
,
pOptions
->
dataDir
,
TD_DIRSEP
);
pDnode
->
dir
.
dnode
=
strdup
(
path
);
pDnode
->
dir
.
dnode
=
t
strdup
(
path
);
if
(
pDnode
->
dir
.
mnode
==
NULL
||
pDnode
->
dir
.
vnodes
==
NULL
||
pDnode
->
dir
.
dnode
==
NULL
)
{
dError
(
"failed to malloc dir object"
);
...
...
@@ -140,7 +140,7 @@ SDnode *dndInit(SDnodeOpt *pOptions) {
taosBlockSIGPIPE
();
taosResolveCRC
();
SDnode
*
pDnode
=
calloc
(
1
,
sizeof
(
p
Dnode
));
SDnode
*
pDnode
=
calloc
(
1
,
sizeof
(
S
Dnode
));
if
(
pDnode
==
NULL
)
{
dError
(
"failed to create dnode object"
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mnode/impl/inc/mnodeDef.h
浏览文件 @
0d57a4be
...
...
@@ -131,7 +131,7 @@ typedef struct SMnodeObj {
int64_t
roleTime
;
int64_t
createdTime
;
int64_t
updateTime
;
SDnodeObj
*
pDn
d
;
SDnodeObj
*
pDn
ode
;
}
SMnodeObj
;
typedef
struct
{
...
...
@@ -215,7 +215,7 @@ typedef struct SDbObj {
typedef
struct
{
int32_t
dnodeId
;
int8_t
role
;
SDnodeObj
*
pDn
d
;
SDnodeObj
*
pDn
ode
;
}
SVnodeGid
;
typedef
struct
SVgObj
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录