Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8058a0f1
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看板
提交
8058a0f1
编写于
3月 24, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xshm
上级
afe99b1f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
18 deletion
+13
-18
source/dnode/mgmt/container/inc/dnd.h
source/dnode/mgmt/container/inc/dnd.h
+2
-7
source/dnode/mgmt/container/inc/dndInt.h
source/dnode/mgmt/container/inc/dndInt.h
+1
-1
source/dnode/mgmt/container/src/dndInt.c
source/dnode/mgmt/container/src/dndInt.c
+7
-8
source/dnode/mgmt/container/src/dndObj.c
source/dnode/mgmt/container/src/dndObj.c
+1
-1
source/dnode/mgmt/container/src/dndTransport.c
source/dnode/mgmt/container/src/dndTransport.c
+1
-1
source/dnode/mgmt/mnode/src/mmInt.c
source/dnode/mgmt/mnode/src/mmInt.c
+1
-0
未找到文件。
source/dnode/mgmt/container/inc/dnd.h
浏览文件 @
8058a0f1
...
...
@@ -19,7 +19,6 @@
#include "os.h"
#include "cJSON.h"
#include "monitor.h"
#include "tcache.h"
#include "tcrc32c.h"
#include "tdatablock.h"
...
...
@@ -36,8 +35,7 @@
#include "tworker.h"
#include "dnode.h"
#include "tfs.h"
#include "wal.h"
#include "monitor.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -53,7 +51,6 @@ extern "C" {
typedef
enum
{
DNODE
,
VNODES
,
QNODE
,
SNODE
,
MNODE
,
BNODE
,
NODE_MAX
}
ENodeType
;
typedef
enum
{
DND_STAT_INIT
,
DND_STAT_RUNNING
,
DND_STAT_STOPPED
}
EDndStatus
;
typedef
enum
{
DND_ENV_INIT
,
DND_ENV_READY
,
DND_ENV_CLEANUP
}
EEnvStatus
;
typedef
enum
{
DND_WORKER_SINGLE
,
DND_WORKER_MULTI
}
EWorkerType
;
typedef
enum
{
PROC_SINGLE
,
PROC_CHILD
,
PROC_PARENT
}
EProcType
;
typedef
struct
SMgmtFp
SMgmtFp
;
...
...
@@ -127,7 +124,6 @@ typedef struct SDnode {
bool
dropped
;
EDndStatus
status
;
EDndEvent
event
;
EProcType
procType
;
SStartupReq
startup
;
TdFilePtr
pLockFile
;
STransMgmt
trans
;
...
...
@@ -138,7 +134,7 @@ EDndStatus dndGetStatus(SDnode *pDnode);
void
dndSetStatus
(
SDnode
*
pDnode
,
EDndStatus
stat
);
SMgmtWrapper
*
dndAcquireWrapper
(
SDnode
*
pDnode
,
ENodeType
nodeType
);
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
int32_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int32_t
vgId
);
void
dndReportStartup
(
SDnode
*
pDnode
,
c
har
*
pName
,
char
*
pDesc
);
void
dndReportStartup
(
SDnode
*
pDnode
,
c
onst
char
*
pName
,
const
char
*
pDesc
);
void
dndSendMonitorReport
(
SDnode
*
pDnode
);
int32_t
dndSendReqToMnode
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
...
...
@@ -146,7 +142,6 @@ int32_t dndSendReqToDnode(SMgmtWrapper *pWrapper, SEpSet *pEpSet, SRpcMsg *pMsg)
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRsp
);
int32_t
dndProcessNodeMsg
(
SDnode
*
pDnode
,
SNodeMsg
*
pMsg
);
int32_t
dndReadFile
(
SMgmtWrapper
*
pWrapper
,
bool
*
pDeployed
);
int32_t
dndWriteFile
(
SMgmtWrapper
*
pWrapper
,
bool
deployed
);
...
...
source/dnode/mgmt/container/inc/dndInt.h
浏览文件 @
8058a0f1
...
...
@@ -34,7 +34,7 @@ int32_t dndInit();
void
dndCleanup
();
const
char
*
dndStatStr
(
EDndStatus
stat
);
void
dndGetStartup
(
SDnode
*
pDnode
,
SStartupReq
*
pStartup
);
TdFilePtr
dndCheckRunning
(
char
*
dataDir
);
TdFilePtr
dndCheckRunning
(
c
onst
c
har
*
dataDir
);
void
dndProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
// dndMsg.c
...
...
source/dnode/mgmt/container/src/dndInt.c
浏览文件 @
8058a0f1
...
...
@@ -15,11 +15,12 @@
#define _DEFAULT_SOURCE
#include "dndInt.h"
#include "wal.h"
static
int8_t
once
=
DND_ENV_INIT
;
int32_t
dndInit
()
{
d
Debug
(
"start to init dnode env"
);
d
Info
(
"start to init dnode env"
);
if
(
atomic_val_compare_exchange_8
(
&
once
,
DND_ENV_INIT
,
DND_ENV_READY
)
!=
DND_ENV_INIT
)
{
terrno
=
TSDB_CODE_REPEAT_INIT
;
dError
(
"failed to init dnode env since %s"
,
terrstr
());
...
...
@@ -52,7 +53,7 @@ int32_t dndInit() {
}
void
dndCleanup
()
{
d
Debug
(
"start to cleanup dnode env"
);
d
Info
(
"start to cleanup dnode env"
);
if
(
atomic_val_compare_exchange_8
(
&
once
,
DND_ENV_READY
,
DND_ENV_CLEANUP
)
!=
DND_ENV_READY
)
{
dError
(
"dnode env is already cleaned up"
);
return
;
...
...
@@ -92,7 +93,7 @@ const char *dndStatStr(EDndStatus status) {
}
}
void
dndReportStartup
(
SDnode
*
pDnode
,
c
har
*
pName
,
char
*
pDesc
)
{
void
dndReportStartup
(
SDnode
*
pDnode
,
c
onst
char
*
pName
,
const
char
*
pDesc
)
{
SStartupReq
*
pStartup
=
&
pDnode
->
startup
;
tstrncpy
(
pStartup
->
name
,
pName
,
TSDB_STEP_NAME_LEN
);
tstrncpy
(
pStartup
->
desc
,
pDesc
,
TSDB_STEP_DESC_LEN
);
...
...
@@ -104,21 +105,21 @@ void dndGetStartup(SDnode *pDnode, SStartupReq *pStartup) {
pStartup
->
finished
=
(
dndGetStatus
(
pDnode
)
==
DND_STAT_RUNNING
);
}
TdFilePtr
dndCheckRunning
(
char
*
dataDir
)
{
TdFilePtr
dndCheckRunning
(
c
onst
c
har
*
dataDir
)
{
char
filepath
[
PATH_MAX
]
=
{
0
};
snprintf
(
filepath
,
sizeof
(
filepath
),
"%s/.running"
,
dataDir
);
TdFilePtr
pFile
=
taosOpenFile
(
filepath
,
TD_FILE_CTEATE
|
TD_FILE_WRITE
|
TD_FILE_TRUNC
);
if
(
pFile
==
NULL
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to lock file:%s since %s
, quit
"
,
filepath
,
terrstr
());
dError
(
"failed to lock file:%s since %s"
,
filepath
,
terrstr
());
return
NULL
;
}
int32_t
ret
=
taosLockFile
(
pFile
);
if
(
ret
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
dError
(
"failed to lock file:%s since %s
, quit
"
,
filepath
,
terrstr
());
dError
(
"failed to lock file:%s since %s"
,
filepath
,
terrstr
());
taosCloseFile
(
&
pFile
);
return
NULL
;
}
...
...
@@ -129,12 +130,10 @@ TdFilePtr dndCheckRunning(char *dataDir) {
void
dndProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
)
{
dDebug
(
"startup req is received"
);
SStartupReq
*
pStartup
=
rpcMallocCont
(
sizeof
(
SStartupReq
));
dndGetStartup
(
pDnode
,
pStartup
);
dDebug
(
"startup req is sent, step:%s desc:%s finished:%d"
,
pStartup
->
name
,
pStartup
->
desc
,
pStartup
->
finished
);
SRpcMsg
rpcRsp
=
{.
handle
=
pReq
->
handle
,
.
pCont
=
pStartup
,
.
contLen
=
sizeof
(
SStartupReq
)};
rpcSendResponse
(
&
rpcRsp
);
}
source/dnode/mgmt/container/src/dndObj.c
浏览文件 @
8058a0f1
...
...
@@ -58,7 +58,7 @@ static void dndClearMemory(SDnode *pDnode) {
SDnode
*
dndCreate
(
const
SDnodeOpt
*
pOption
)
{
dInfo
(
"start to create dnode object"
);
int32_t
code
=
-
1
;
char
path
[
PATH_MAX
];
char
path
[
PATH_MAX
]
=
{
0
}
;
SDnode
*
pDnode
=
NULL
;
pDnode
=
calloc
(
1
,
sizeof
(
SDnode
));
...
...
source/dnode/mgmt/container/src/dndTransport.c
浏览文件 @
8058a0f1
...
...
@@ -271,7 +271,7 @@ int32_t dndInitMsgHandle(SDnode *pDnode) {
int32_t
vgId
=
pWrapper
->
msgVgIds
[
msgIndex
];
if
(
msgFp
==
NULL
)
continue
;
dTrace
(
"msg:%s will be processed by %s, vgId:%d"
,
tMsgInfo
[
msgIndex
],
pWrapper
->
name
,
vgId
);
//
dTrace("msg:%s will be processed by %s, vgId:%d", tMsgInfo[msgIndex], pWrapper->name, vgId);
SMsgHandle
*
pHandle
=
&
pMgmt
->
msgHandles
[
msgIndex
];
if
(
vgId
==
QND_VGID
)
{
...
...
source/dnode/mgmt/mnode/src/mmInt.c
浏览文件 @
8058a0f1
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "mmInt.h"
#include "wal.h"
static
bool
mmDeployRequired
(
SDnode
*
pDnode
)
{
if
(
pDnode
->
dnodeId
>
0
)
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录