Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a5d0e01a
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a5d0e01a
编写于
4月 15, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix error in sdb
上级
cc52d293
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
32 addition
and
16 deletion
+32
-16
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+12
-9
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/inc/mpeer.h
src/inc/mpeer.h
+1
-0
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+1
-0
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+1
-0
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+8
-0
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+7
-5
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+1
-1
未找到文件。
src/dnode/src/dnodeMClient.c
浏览文件 @
a5d0e01a
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "dnodeModule.h"
#include "dnodeModule.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
#include "vnode.h"
#include "vnode.h"
#include "mpeer.h"
#define MPEER_CONTENT_LEN 2000
#define MPEER_CONTENT_LEN 2000
...
@@ -148,6 +149,15 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
...
@@ -148,6 +149,15 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
return
;
return
;
}
}
SDnodeState
*
pState
=
&
pStatusRsp
->
dnodeState
;
pState
->
numOfVnodes
=
htonl
(
pState
->
numOfVnodes
);
pState
->
moduleStatus
=
htonl
(
pState
->
moduleStatus
);
pState
->
createdTime
=
htonl
(
pState
->
createdTime
);
pState
->
dnodeId
=
htonl
(
pState
->
dnodeId
);
dnodeProcessModuleStatus
(
pState
->
moduleStatus
);
dnodeUpdateDnodeInfo
(
pState
->
dnodeId
);
SRpcIpSet
mgmtIpSet
=
{
0
};
SRpcIpSet
mgmtIpSet
=
{
0
};
mgmtIpSet
.
inUse
=
mpeers
->
inUse
;
mgmtIpSet
.
inUse
=
mpeers
->
inUse
;
mgmtIpSet
.
numOfIps
=
mpeers
->
nodeNum
;
mgmtIpSet
.
numOfIps
=
mpeers
->
nodeNum
;
...
@@ -167,20 +177,13 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
...
@@ -167,20 +177,13 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
tsMnodeInfos
.
nodeInfos
[
i
].
nodePort
=
htons
(
mpeers
->
nodeInfos
[
i
].
nodePort
);
tsMnodeInfos
.
nodeInfos
[
i
].
nodePort
=
htons
(
mpeers
->
nodeInfos
[
i
].
nodePort
);
strcpy
(
tsMnodeInfos
.
nodeInfos
[
i
].
nodeName
,
mpeers
->
nodeInfos
[
i
].
nodeName
);
strcpy
(
tsMnodeInfos
.
nodeInfos
[
i
].
nodeName
,
mpeers
->
nodeInfos
[
i
].
nodeName
);
dPrint
(
"mnode:%d, ip:%s:%u name:%s"
,
tsMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
dPrint
(
"mnode:%d, ip:%s:%u name:%s"
,
tsMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
taosIpStr
(
tsMnodeInfos
.
nodeInfos
[
i
].
nodeI
d
),
tsMnodeInfos
.
nodeInfos
[
i
].
nodePort
,
taosIpStr
(
tsMnodeInfos
.
nodeInfos
[
i
].
nodeI
p
),
tsMnodeInfos
.
nodeInfos
[
i
].
nodePort
,
tsMnodeInfos
.
nodeInfos
[
i
].
nodeName
);
tsMnodeInfos
.
nodeInfos
[
i
].
nodeName
);
}
}
dnodeSaveMnodeIpList
();
dnodeSaveMnodeIpList
();
mpeerUpdateSync
();
}
}
SDnodeState
*
pState
=
&
pStatusRsp
->
dnodeState
;
pState
->
numOfVnodes
=
htonl
(
pState
->
numOfVnodes
);
pState
->
moduleStatus
=
htonl
(
pState
->
moduleStatus
);
pState
->
createdTime
=
htonl
(
pState
->
createdTime
);
pState
->
dnodeId
=
htonl
(
pState
->
dnodeId
);
dnodeProcessModuleStatus
(
pState
->
moduleStatus
);
dnodeUpdateDnodeInfo
(
pState
->
dnodeId
);
taosTmrReset
(
dnodeSendStatusMsg
,
tsStatusInterval
*
1000
,
NULL
,
tsDnodeTmr
,
&
tsStatusTimer
);
taosTmrReset
(
dnodeSendStatusMsg
,
tsStatusInterval
*
1000
,
NULL
,
tsDnodeTmr
,
&
tsStatusTimer
);
}
}
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
a5d0e01a
...
@@ -159,10 +159,10 @@ static int32_t dnodeInitSystem() {
...
@@ -159,10 +159,10 @@ static int32_t dnodeInitSystem() {
dPrint
(
"starting to initialize TDengine ..."
);
dPrint
(
"starting to initialize TDengine ..."
);
if
(
dnodeInitStorage
()
!=
0
)
return
-
1
;
if
(
dnodeInitStorage
()
!=
0
)
return
-
1
;
if
(
dnodeInitModules
()
!=
0
)
return
-
1
;
if
(
dnodeInitRead
()
!=
0
)
return
-
1
;
if
(
dnodeInitRead
()
!=
0
)
return
-
1
;
if
(
dnodeInitWrite
()
!=
0
)
return
-
1
;
if
(
dnodeInitWrite
()
!=
0
)
return
-
1
;
if
(
dnodeInitMClient
()
!=
0
)
return
-
1
;
if
(
dnodeInitMClient
()
!=
0
)
return
-
1
;
if
(
dnodeInitModules
()
!=
0
)
return
-
1
;
if
(
dnodeInitMnode
()
!=
0
)
return
-
1
;
if
(
dnodeInitMnode
()
!=
0
)
return
-
1
;
if
(
dnodeInitMgmt
()
!=
0
)
return
-
1
;
if
(
dnodeInitMgmt
()
!=
0
)
return
-
1
;
if
(
dnodeInitShell
()
!=
0
)
return
-
1
;
if
(
dnodeInitShell
()
!=
0
)
return
-
1
;
...
...
src/inc/mpeer.h
浏览文件 @
a5d0e01a
...
@@ -50,6 +50,7 @@ void mpeerGetPublicIpList(SRpcIpSet *ipSet);
...
@@ -50,6 +50,7 @@ void mpeerGetPublicIpList(SRpcIpSet *ipSet);
void
mpeerGetMpeerInfos
(
void
*
mpeers
);
void
mpeerGetMpeerInfos
(
void
*
mpeers
);
int32_t
mpeerForwardReqToPeer
(
void
*
pHead
);
int32_t
mpeerForwardReqToPeer
(
void
*
pHead
);
void
mpeerUpdateSync
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/src/mgmtDnode.c
浏览文件 @
a5d0e01a
...
@@ -77,6 +77,7 @@ void * clusterGetDnode(int32_t dnodeId) { return dnodeId == 1 ? &tsDnodeObj : N
...
@@ -77,6 +77,7 @@ void * clusterGetDnode(int32_t dnodeId) { return dnodeId == 1 ? &tsDnodeObj : N
void
*
clusterGetDnodeByIp
(
uint32_t
ip
)
{
return
&
tsDnodeObj
;
}
void
*
clusterGetDnodeByIp
(
uint32_t
ip
)
{
return
&
tsDnodeObj
;
}
void
clusterReleaseDnode
(
struct
_dnode_obj
*
pDnode
)
{}
void
clusterReleaseDnode
(
struct
_dnode_obj
*
pDnode
)
{}
void
clusterUpdateDnode
(
struct
_dnode_obj
*
pDnode
)
{}
void
clusterUpdateDnode
(
struct
_dnode_obj
*
pDnode
)
{}
void
clusterMonitorDnodeModule
()
{}
#endif
#endif
...
...
src/mnode/src/mgmtMnode.c
浏览文件 @
a5d0e01a
...
@@ -48,6 +48,7 @@ void * mpeerGetMnode(int32_t mnodeId) { return &tsMnodeObj; }
...
@@ -48,6 +48,7 @@ void * mpeerGetMnode(int32_t mnodeId) { return &tsMnodeObj; }
int32_t
mpeerGetMnodesNum
()
{
return
1
;
}
int32_t
mpeerGetMnodesNum
()
{
return
1
;
}
void
mpeerReleaseMnode
(
struct
_mnode_obj
*
pMnode
)
{}
void
mpeerReleaseMnode
(
struct
_mnode_obj
*
pMnode
)
{}
bool
mpeerIsMaster
()
{
return
tsMnodeObj
.
role
==
TAOS_SYNC_ROLE_MASTER
;
}
bool
mpeerIsMaster
()
{
return
tsMnodeObj
.
role
==
TAOS_SYNC_ROLE_MASTER
;
}
void
mpeerUpdateSync
()
{}
void
*
mpeerGetNextMnode
(
void
*
pNode
,
SMnodeObj
**
pMnode
)
{
void
*
mpeerGetNextMnode
(
void
*
pNode
,
SMnodeObj
**
pMnode
)
{
if
(
*
pMnode
==
NULL
)
{
if
(
*
pMnode
==
NULL
)
{
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
a5d0e01a
...
@@ -130,6 +130,9 @@ int32_t sdbInit() {
...
@@ -130,6 +130,9 @@ int32_t sdbInit() {
}
}
sdbTrace
(
"sdb is initialized, version:%d totalRows:%d numOfTables:%d"
,
tsSdbObj
->
version
,
totalRows
,
numOfTables
);
sdbTrace
(
"sdb is initialized, version:%d totalRows:%d numOfTables:%d"
,
tsSdbObj
->
version
,
totalRows
,
numOfTables
);
mpeerUpdateSync
();
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -215,6 +218,11 @@ static int32_t sdbInsertLocal(SSdbTable *pTable, SSdbOperDesc *pOper) {
...
@@ -215,6 +218,11 @@ static int32_t sdbInsertLocal(SSdbTable *pTable, SSdbOperDesc *pOper) {
(
*
sdbAddIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
pOper
->
pObj
,
&
rowMeta
);
(
*
sdbAddIndexFp
[
pTable
->
keyType
])(
pTable
->
iHandle
,
pOper
->
pObj
,
&
rowMeta
);
sdbIncRef
(
pTable
,
pOper
->
pObj
);
sdbIncRef
(
pTable
,
pOper
->
pObj
);
pTable
->
numOfRows
++
;
pTable
->
numOfRows
++
;
if
(
pTable
->
keyType
==
SDB_KEY_AUTO
)
{
pTable
->
autoIndex
=
MAX
(
pTable
->
autoIndex
,
*
((
uint32_t
*
)
pOper
->
pObj
));
}
pthread_mutex_unlock
(
&
pTable
->
mutex
);
pthread_mutex_unlock
(
&
pTable
->
mutex
);
sdbTrace
(
"table:%s, insert record:%s, numOfRows:%d"
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pOper
->
pObj
),
sdbTrace
(
"table:%s, insert record:%s, numOfRows:%d"
,
pTable
->
tableName
,
sdbGetkeyStr
(
pTable
,
pOper
->
pObj
),
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
a5d0e01a
...
@@ -85,11 +85,13 @@ static int32_t mgmtUserActionDecode(SSdbOperDesc *pOper) {
...
@@ -85,11 +85,13 @@ static int32_t mgmtUserActionDecode(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtUserActionRestored
()
{
static
int32_t
mgmtUserActionRestored
()
{
SAcctObj
*
pAcct
=
acctGetAcct
(
"root"
);
if
(
strcmp
(
tsMasterIp
,
tsPrivateIp
)
==
0
)
{
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
SAcctObj
*
pAcct
=
acctGetAcct
(
"root"
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
mgmtCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
acctReleaseAcct
(
pAcct
);
mgmtCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
acctReleaseAcct
(
pAcct
);
}
return
0
;
return
0
;
}
}
...
...
src/plugins/http/src/httpSystem.c
浏览文件 @
a5d0e01a
...
@@ -129,7 +129,7 @@ void httpCleanUpSystem() {
...
@@ -129,7 +129,7 @@ void httpCleanUpSystem() {
httpPrint
(
"http service cleanup"
);
httpPrint
(
"http service cleanup"
);
httpStopSystem
();
httpStopSystem
();
#if
1
#if
0
if (httpServer == NULL) {
if (httpServer == NULL) {
return;
return;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录