Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d7e13ef7
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看板
提交
d7e13ef7
编写于
3月 25, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
474939ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
13 deletion
+25
-13
include/util/tprocess.h
include/util/tprocess.h
+1
-0
source/dnode/mgmt/container/src/dndExec.c
source/dnode/mgmt/container/src/dndExec.c
+15
-10
source/dnode/mgmt/container/src/dndObj.c
source/dnode/mgmt/container/src/dndObj.c
+1
-1
source/util/src/tprocess.c
source/util/src/tprocess.c
+8
-2
未找到文件。
include/util/tprocess.h
浏览文件 @
d7e13ef7
...
...
@@ -51,6 +51,7 @@ void taosProcCleanup(SProcObj *pProc);
int32_t
taosProcRun
(
SProcObj
*
pProc
);
void
taosProcStop
(
SProcObj
*
pProc
);
bool
taosProcIsChild
(
SProcObj
*
pProc
);
int32_t
taosProcChildId
(
SProcObj
*
pProc
);
int32_t
taosProcPutToChildQueue
(
SProcObj
*
pProc
,
void
*
pHead
,
int32_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
);
int32_t
taosProcPutToParentQueue
(
SProcObj
*
pProc
,
void
*
pHead
,
int32_t
headLen
,
void
*
pBody
,
int32_t
bodyLen
);
...
...
source/dnode/mgmt/container/src/dndExec.c
浏览文件 @
d7e13ef7
...
...
@@ -20,7 +20,7 @@ static void dndResetLog(SMgmtWrapper *pMgmt) {
char
logname
[
24
]
=
{
0
};
snprintf
(
logname
,
sizeof
(
logname
),
"%slog"
,
pMgmt
->
name
);
dInfo
(
"node:%s, reset log to %s"
,
pMgmt
->
name
,
logname
);
dInfo
(
"node:%s, reset log to %s
in child process
"
,
pMgmt
->
name
,
logname
);
taosCloseLog
();
taosInitLog
(
logname
,
1
);
}
...
...
@@ -51,6 +51,7 @@ int32_t dndOpenNode(SMgmtWrapper *pWrapper) {
void
dndCloseNode
(
SMgmtWrapper
*
pWrapper
)
{
dDebug
(
"node:%s, start to close"
,
pWrapper
->
name
);
pWrapper
->
required
=
false
;
taosWLockLatch
(
&
pWrapper
->
latch
);
if
(
pWrapper
->
deployed
)
{
(
*
pWrapper
->
fp
.
closeFp
)(
pWrapper
);
...
...
@@ -199,7 +200,7 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
dInfo
(
"node:%s, will be initialized in child process"
,
pWrapper
->
name
);
dndOpenNode
(
pWrapper
);
}
else
{
dInfo
(
"node:%s, will not start in parent process
"
,
pWrapper
->
name
);
dInfo
(
"node:%s, will not start in parent process
, child pid:%d"
,
pWrapper
->
name
,
taosProcChildId
(
pProc
)
);
pWrapper
->
procType
=
PROC_PARENT
;
}
...
...
@@ -209,16 +210,20 @@ static int32_t dndRunInMultiProcess(SDnode *pDnode) {
}
}
#if 0
SMgmtWrapper *pWrapper = dndAcquireWrapper(pDnode, DNODE);
if (pWrapper->procType == PROC_PARENT && dmStart(pWrapper->pMgmt) != 0) {
dndReleaseWrapper(pWrapper);
dError("failed to start dnode worker since %s", terrstr());
return -1;
dndSetStatus
(
pDnode
,
DND_STAT_RUNNING
);
for
(
ENodeType
n
=
0
;
n
<
NODE_MAX
;
++
n
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
n
];
if
(
!
pWrapper
->
required
)
continue
;
if
(
pWrapper
->
fp
.
startFp
==
NULL
)
continue
;
if
(
pWrapper
->
procType
==
PROC_PARENT
&&
n
!=
DNODE
)
continue
;
if
(
pWrapper
->
procType
==
PROC_CHILD
&&
n
==
DNODE
)
continue
;
if
((
*
pWrapper
->
fp
.
startFp
)(
pWrapper
)
!=
0
)
{
dError
(
"node:%s, failed to start since %s"
,
pWrapper
->
name
,
terrstr
());
return
-
1
;
}
}
dndReleaseWrapper(pWrapper);
#endif
return
0
;
}
...
...
source/dnode/mgmt/container/src/dndObj.c
浏览文件 @
d7e13ef7
...
...
@@ -175,7 +175,7 @@ int32_t dndMarkWrapper(SMgmtWrapper *pWrapper) {
int32_t
code
=
0
;
taosRLockLatch
(
&
pWrapper
->
latch
);
if
(
pWrapper
->
deployed
)
{
if
(
pWrapper
->
deployed
||
(
pWrapper
->
procType
==
PROC_PARENT
&&
pWrapper
->
required
)
)
{
int32_t
refCount
=
atomic_add_fetch_32
(
&
pWrapper
->
refCount
,
1
);
dTrace
(
"node:%s, is marked, refCount:%d"
,
pWrapper
->
name
,
refCount
);
}
else
{
...
...
source/util/src/tprocess.c
浏览文件 @
d7e13ef7
...
...
@@ -208,6 +208,11 @@ static int32_t taosProcQueuePush(SProcQueue *pQueue, char *pHead, int32_t rawHea
const
int32_t
bodyLen
=
CEIL8
(
rawBodyLen
);
const
int32_t
fullLen
=
headLen
+
bodyLen
+
8
;
if
(
headLen
<=
0
||
bodyLen
<=
0
)
{
terrno
=
TSDB_CODE_INVALID_PARA
;
return
-
1
;
}
taosThreadMutexLock
(
pQueue
->
mutex
);
if
(
fullLen
>
pQueue
->
avail
)
{
taosThreadMutexUnlock
(
pQueue
->
mutex
);
...
...
@@ -259,7 +264,7 @@ static int32_t taosProcQueuePush(SProcQueue *pQueue, char *pHead, int32_t rawHea
taosThreadMutexUnlock
(
pQueue
->
mutex
);
tsem_post
(
&
pQueue
->
sem
);
uTrace
(
"proc:%s, push msg:%p:%d cont:%p:%d to queue:%p"
,
pQueue
->
name
,
pHead
,
rawHeadLen
,
pBody
,
rawB
odyLen
,
pQueue
);
uTrace
(
"proc:%s, push msg:%p:%d cont:%p:%d to queue:%p"
,
pQueue
->
name
,
pHead
,
headLen
,
pBody
,
b
odyLen
,
pQueue
);
return
0
;
}
...
...
@@ -376,7 +381,6 @@ SProcObj *taosProcInit(const SProcCfg *pCfg) {
pProc
->
pid
=
fork
();
if
(
pProc
->
pid
==
0
)
{
pProc
->
isChild
=
1
;
uInfo
(
"this is child process, pid:%d"
,
pProc
->
pid
);
}
else
{
pProc
->
isChild
=
0
;
uInfo
(
"this is parent process, child pid:%d"
,
pProc
->
pid
);
...
...
@@ -439,6 +443,8 @@ void taosProcStop(SProcObj *pProc) {
bool
taosProcIsChild
(
SProcObj
*
pProc
)
{
return
pProc
->
isChild
;
}
int32_t
taosProcChildId
(
SProcObj
*
pProc
)
{
return
pProc
->
pid
;
}
void
taosProcCleanup
(
SProcObj
*
pProc
)
{
if
(
pProc
!=
NULL
)
{
uDebug
(
"proc:%s, clean up"
,
pProc
->
name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录