Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9b7f04b0
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
9b7f04b0
编写于
10月 27, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1762
上级
cfdc8c15
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
47 addition
and
27 deletion
+47
-27
src/dnode/src/dnodeCfg.c
src/dnode/src/dnodeCfg.c
+5
-1
src/dnode/src/dnodeCheck.c
src/dnode/src/dnodeCheck.c
+1
-3
src/dnode/src/dnodeEps.c
src/dnode/src/dnodeEps.c
+5
-1
src/dnode/src/dnodeMInfos.c
src/dnode/src/dnodeMInfos.c
+6
-1
src/dnode/src/dnodeMPeer.c
src/dnode/src/dnodeMPeer.c
+1
-1
src/dnode/src/dnodeMRead.c
src/dnode/src/dnodeMRead.c
+1
-1
src/dnode/src/dnodeMWrite.c
src/dnode/src/dnodeMWrite.c
+1
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+0
-1
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+1
-0
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+2
-2
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-1
src/dnode/src/dnodeTelemetry.c
src/dnode/src/dnodeTelemetry.c
+1
-0
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+1
-1
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-1
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+11
-5
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+2
-2
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+3
-2
src/rpc/src/rpcUdp.c
src/rpc/src/rpcUdp.c
+3
-2
未找到文件。
src/dnode/src/dnodeCfg.c
浏览文件 @
9b7f04b0
...
...
@@ -32,7 +32,11 @@ static void dnodePrintCfg(SDnodeCfg *cfg);
int32_t
dnodeInitCfg
()
{
pthread_mutex_init
(
&
tsCfgMutex
,
NULL
);
dnodeResetCfg
(
NULL
);
return
dnodeReadCfg
();
int32_t
ret
=
dnodeReadCfg
();
if
(
ret
==
0
)
{
dInfo
(
"dnode cfg is initialized"
);
}
return
ret
;
}
void
dnodeCleanupCfg
()
{
pthread_mutex_destroy
(
&
tsCfgMutex
);
}
...
...
src/dnode/src/dnodeCheck.c
浏览文件 @
9b7f04b0
...
...
@@ -262,8 +262,6 @@ int32_t dnodeInitCheck() {
}
}
dInfo
(
"dnode check is initialized"
);
return
0
;
}
src/dnode/src/dnodeEps.c
浏览文件 @
9b7f04b0
...
...
@@ -35,7 +35,11 @@ int32_t dnodeInitEps() {
pthread_mutex_init
(
&
tsEpsMutex
,
NULL
);
tsEpsHash
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
true
);
dnodeResetEps
(
NULL
);
return
dnodeReadEps
();
int32_t
ret
=
dnodeReadEps
();
if
(
ret
==
0
)
{
dInfo
(
"dnode eps is initialized"
);
}
return
ret
;
}
void
dnodeCleanupEps
()
{
...
...
src/dnode/src/dnodeMInfos.c
浏览文件 @
9b7f04b0
...
...
@@ -34,7 +34,12 @@ static int32_t dnodeWriteMInfos();
int32_t
dnodeInitMInfos
()
{
pthread_mutex_init
(
&
tsMInfosMutex
,
NULL
);
dnodeResetMInfos
(
NULL
);
return
dnodeReadMInfos
();
int32_t
ret
=
dnodeReadMInfos
();
if
(
ret
==
0
)
{
dInfo
(
"dnode minfos is initialized"
);
}
return
ret
;
}
void
dnodeCleanupMInfos
()
{
pthread_mutex_destroy
(
&
tsMInfosMutex
);
}
...
...
src/dnode/src/dnodeMPeer.c
浏览文件 @
9b7f04b0
...
...
@@ -58,7 +58,7 @@ int32_t dnodeInitMnodePeer() {
dDebug
(
"dnode mpeer worker:%d is created"
,
i
);
}
dDebug
(
"dnode mpeer is
open
ed, workers:%d qset:%p"
,
tsMPeerPool
.
maxNum
,
tsMPeerQset
);
dDebug
(
"dnode mpeer is
initializ
ed, workers:%d qset:%p"
,
tsMPeerPool
.
maxNum
,
tsMPeerQset
);
return
0
;
}
...
...
src/dnode/src/dnodeMRead.c
浏览文件 @
9b7f04b0
...
...
@@ -60,7 +60,7 @@ int32_t dnodeInitMnodeRead() {
dDebug
(
"dnode mread worker:%d is created"
,
i
);
}
dDebug
(
"dnode mread is
open
ed, workers:%d qset:%p"
,
tsMReadPool
.
maxNum
,
tsMReadQset
);
dDebug
(
"dnode mread is
initializ
ed, workers:%d qset:%p"
,
tsMReadPool
.
maxNum
,
tsMReadQset
);
return
0
;
}
...
...
src/dnode/src/dnodeMWrite.c
浏览文件 @
9b7f04b0
...
...
@@ -60,7 +60,7 @@ int32_t dnodeInitMnodeWrite() {
dDebug
(
"dnode mwrite worker:%d is created"
,
i
);
}
dDebug
(
"dnode mwrite is
open
ed, workers:%d qset:%p"
,
tsMWritePool
.
maxNum
,
tsMWriteQset
);
dDebug
(
"dnode mwrite is
initializ
ed, workers:%d qset:%p"
,
tsMWritePool
.
maxNum
,
tsMWriteQset
);
return
0
;
}
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
9b7f04b0
...
...
@@ -205,7 +205,7 @@ static int32_t dnodeInitStorage() {
dnodeCheckDataDirOpenned
(
tsDnodeDir
);
dInfo
(
"
storage directory is initialized"
);
dInfo
(
"
dnode storage is initialized at %s"
,
tsDnodeDir
);
return
0
;
}
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
9b7f04b0
...
...
@@ -79,7 +79,6 @@ int32_t dnodeInitMgmt() {
dnodeAddClientRspHandle
(
TSDB_MSG_TYPE_DM_STATUS_RSP
,
dnodeProcessStatusRsp
);
tsRebootTime
=
taosGetTimestampSec
();
int32_t
code
=
vnodeInitResources
();
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
dnodeCleanupMgmt
();
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
9b7f04b0
...
...
@@ -114,6 +114,7 @@ int32_t dnodeInitModules() {
}
}
dInfo
(
"dnode modules is initialized"
);
return
0
;
}
...
...
src/dnode/src/dnodePeer.c
浏览文件 @
9b7f04b0
...
...
@@ -72,7 +72,7 @@ int32_t dnodeInitServer() {
return
-
1
;
}
dInfo
(
"
inter-dnodes RPC server is open
ed"
);
dInfo
(
"
dnode inter-dnodes RPC server is initializ
ed"
);
return
0
;
}
...
...
@@ -137,7 +137,7 @@ int32_t dnodeInitClient() {
return
-
1
;
}
dInfo
(
"in
ter-dnodes rpc client is open
ed"
);
dInfo
(
"in
itialized inter-dnodes rpc client is initializ
ed"
);
return
0
;
}
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
9b7f04b0
...
...
@@ -97,7 +97,7 @@ int32_t dnodeInitShell() {
return
-
1
;
}
dInfo
(
"
shell rpc server is open
ed"
);
dInfo
(
"
dnode shell rpc server is initializ
ed"
);
return
0
;
}
...
...
src/dnode/src/dnodeTelemetry.c
浏览文件 @
9b7f04b0
...
...
@@ -299,6 +299,7 @@ int32_t dnodeInitTelemetry() {
dTrace
(
"failed to create telemetry thread, reason:%s"
,
strerror
(
errno
));
}
dInfo
(
"dnode telemetry is initialized"
);
return
0
;
}
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
9b7f04b0
...
...
@@ -61,7 +61,7 @@ int32_t dnodeInitVnodeRead() {
pWorker
->
workerId
=
i
;
}
dInfo
(
"dnode read is
open
ed, min worker:%d max worker:%d"
,
readPool
.
min
,
readPool
.
max
);
dInfo
(
"dnode read is
initializ
ed, min worker:%d max worker:%d"
,
readPool
.
min
,
readPool
.
max
);
return
0
;
}
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
9b7f04b0
...
...
@@ -69,7 +69,7 @@ int32_t dnodeInitVnodeWrite() {
wWorkerPool
.
writeWorker
[
i
].
workerId
=
i
;
}
dInfo
(
"dnode write is
open
ed, max worker %d"
,
wWorkerPool
.
max
);
dInfo
(
"dnode write is
initializ
ed, max worker %d"
,
wWorkerPool
.
max
);
return
0
;
}
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
9b7f04b0
...
...
@@ -440,9 +440,11 @@ static int32_t mnodeGetDnodeEpsSize() {
return
size
;
}
static
void
mnodeGetDnodeEpsData
(
SDnodeEps
*
pEps
)
{
static
void
mnodeGetDnodeEpsData
(
SDnodeEps
*
pEps
,
int32_t
epsSize
)
{
pthread_mutex_lock
(
&
tsDnodeEpsMutex
);
memcpy
(
pEps
,
tsDnodeEps
,
tsDnodeEpsSize
);
if
(
epsSize
==
tsDnodeEpsSize
)
{
memcpy
(
pEps
,
tsDnodeEps
,
tsDnodeEpsSize
);
}
pthread_mutex_unlock
(
&
tsDnodeEpsMutex
);
}
...
...
@@ -451,6 +453,7 @@ static void mnodeUpdateDnodeEps() {
int32_t
totalDnodes
=
mnodeGetDnodesNum
();
tsDnodeEpsSize
=
sizeof
(
SDnodeEps
)
+
totalDnodes
*
sizeof
(
SDnodeEp
);
free
(
tsDnodeEps
);
tsDnodeEps
=
calloc
(
1
,
tsDnodeEpsSize
);
tsDnodeEps
->
dnodeNum
=
htonl
(
totalDnodes
);
...
...
@@ -534,7 +537,10 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
}
int32_t
openVnodes
=
htons
(
pStatus
->
openVnodes
);
int32_t
contLen
=
sizeof
(
SDMStatusRsp
)
+
openVnodes
*
sizeof
(
SDMVgroupAccess
)
+
mnodeGetDnodeEpsSize
();
int32_t
epsSize
=
mnodeGetDnodeEpsSize
();
int32_t
vgAccessSize
=
openVnodes
*
sizeof
(
SDMVgroupAccess
);
int32_t
contLen
=
sizeof
(
SDMStatusRsp
)
+
vgAccessSize
+
epsSize
;
SDMStatusRsp
*
pRsp
=
rpcMallocCont
(
contLen
);
if
(
pRsp
==
NULL
)
{
mnodeDecDnodeRef
(
pDnode
);
...
...
@@ -596,8 +602,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
mnodeDecDnodeRef
(
pDnode
);
SDnodeEps
*
pEps
=
(
SDnodeEps
*
)((
char
*
)
p
Access
+
openVnodes
*
sizeof
(
SDMVgroupAccess
)
);
mnodeGetDnodeEpsData
(
pEps
);
SDnodeEps
*
pEps
=
(
SDnodeEps
*
)((
char
*
)
p
Rsp
+
sizeof
(
SDMStatusRsp
)
+
vgAccessSize
);
mnodeGetDnodeEpsData
(
pEps
,
epsSize
);
pMsg
->
rpcRsp
.
len
=
contLen
;
pMsg
->
rpcRsp
.
rsp
=
pRsp
;
...
...
src/rpc/src/rpcMain.c
浏览文件 @
9b7f04b0
...
...
@@ -323,7 +323,7 @@ void *rpcMallocCont(int contLen) {
tError
(
"failed to malloc msg, size:%d"
,
size
);
return
NULL
;
}
else
{
tTrace
(
"malloc mem:
%p"
,
start
);
tTrace
(
"malloc mem:
%p size:%d"
,
start
,
size
);
}
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
...
...
@@ -1453,7 +1453,7 @@ static SRpcHead *rpcDecompressRpcMsg(SRpcHead *pHead) {
pNewHead
->
msgLen
=
rpcMsgLenFromCont
(
origLen
);
rpcFreeMsg
(
pHead
);
// free the compressed message buffer
pHead
=
pNewHead
;
tTrace
(
"decomp malloc mem:
%p"
,
temp
);
tTrace
(
"decomp malloc mem:%p"
,
temp
);
}
else
{
tError
(
"failed to allocate memory to decompress msg, contLen:%d"
,
contLen
);
}
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
9b7f04b0
...
...
@@ -437,12 +437,13 @@ static int taosReadTcpData(SFdObj *pFdObj, SRecvInfo *pInfo) {
}
msgLen
=
(
int32_t
)
htonl
((
uint32_t
)
rpcHead
.
msgLen
);
buffer
=
malloc
(
msgLen
+
tsRpcOverhead
);
int32_t
size
=
msgLen
+
tsRpcOverhead
;
buffer
=
malloc
(
size
);
if
(
NULL
==
buffer
)
{
tError
(
"%s %p TCP malloc(size:%d) fail"
,
pThreadObj
->
label
,
pFdObj
->
thandle
,
msgLen
);
return
-
1
;
}
else
{
tTrace
(
"TCP malloc mem:
%p"
,
buffer
);
tTrace
(
"TCP malloc mem:
%p size:%d"
,
buffer
,
size
);
}
msg
=
buffer
+
tsRpcOverhead
;
...
...
src/rpc/src/rpcUdp.c
浏览文件 @
9b7f04b0
...
...
@@ -209,12 +209,13 @@ static void *taosRecvUdpData(void *param) {
continue
;
}
char
*
tmsg
=
malloc
(
dataLen
+
tsRpcOverhead
);
int32_t
size
=
dataLen
+
tsRpcOverhead
;
char
*
tmsg
=
malloc
(
size
);
if
(
NULL
==
tmsg
)
{
tError
(
"%s failed to allocate memory, size:%"
PRId64
,
pConn
->
label
,
(
int64_t
)
dataLen
);
continue
;
}
else
{
tTrace
(
"UDP malloc mem:
%p"
,
tmsg
);
tTrace
(
"UDP malloc mem:
%p size:%d"
,
tmsg
,
size
);
}
tmsg
+=
tsRpcOverhead
;
// overhead for SRpcReqContext
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录