Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c5032196
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
c5032196
编写于
5月 08, 2020
作者:
J
jtao1735
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
massage the code to make the system structure more clear
上级
c7a06693
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
127 addition
and
130 deletion
+127
-130
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+2
-1
src/common/src/tglobal.c
src/common/src/tglobal.c
+6
-5
src/cq/test/cqtest.c
src/cq/test/cqtest.c
+2
-2
src/dnode/inc/dnodeInt.h
src/dnode/inc/dnodeInt.h
+5
-15
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+1
-1
src/dnode/inc/dnodeVRead.h
src/dnode/inc/dnodeVRead.h
+1
-1
src/dnode/inc/dnodeVWrite.h
src/dnode/inc/dnodeVWrite.h
+1
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+3
-3
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+4
-4
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+1
-1
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+11
-11
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+6
-6
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+3
-3
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+3
-3
src/rpc/test/rserver.c
src/rpc/test/rserver.c
+1
-1
src/vnode/inc/vnodeInt.h
src/vnode/inc/vnodeInt.h
+9
-0
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+55
-59
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+3
-3
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+8
-8
src/wal/test/waltest.c
src/wal/test/waltest.c
+2
-2
未找到文件。
src/common/inc/tglobal.h
浏览文件 @
c5032196
...
@@ -139,7 +139,8 @@ extern int32_t tsMonitorInterval;
...
@@ -139,7 +139,8 @@ extern int32_t tsMonitorInterval;
extern
int32_t
tsAsyncLog
;
extern
int32_t
tsAsyncLog
;
extern
int32_t
tsNumOfLogLines
;
extern
int32_t
tsNumOfLogLines
;
extern
int32_t
ddebugFlag
;
extern
int32_t
dDebugFlag
;
extern
int32_t
vDebugFlag
;
extern
int32_t
mdebugFlag
;
extern
int32_t
mdebugFlag
;
extern
int32_t
cdebugFlag
;
extern
int32_t
cdebugFlag
;
extern
int32_t
jnidebugFlag
;
extern
int32_t
jnidebugFlag
;
...
...
src/common/src/tglobal.c
浏览文件 @
c5032196
...
@@ -129,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
...
@@ -129,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
int32_t
tsNumOfLogLines
=
10000000
;
int32_t
tsNumOfLogLines
=
10000000
;
int32_t
mdebugFlag
=
135
;
int32_t
mdebugFlag
=
135
;
int32_t
sdbDebugFlag
=
135
;
int32_t
sdbDebugFlag
=
135
;
int32_t
ddebugFlag
=
131
;
int32_t
dDebugFlag
=
135
;
int32_t
cdebugFlag
=
131
;
int32_t
vDebugFlag
=
135
;
int32_t
cdebugFlag
=
135
;
int32_t
jnidebugFlag
=
131
;
int32_t
jnidebugFlag
=
131
;
int32_t
odbcdebugFlag
=
131
;
int32_t
odbcdebugFlag
=
131
;
int32_t
httpDebugFlag
=
131
;
int32_t
httpDebugFlag
=
131
;
int32_t
monitorDebugFlag
=
131
;
int32_t
monitorDebugFlag
=
131
;
int32_t
qdebugFlag
=
131
;
int32_t
qdebugFlag
=
131
;
int32_t
rpcDebugFlag
=
13
1
;
int32_t
rpcDebugFlag
=
13
5
;
int32_t
uDebugFlag
=
131
;
int32_t
uDebugFlag
=
131
;
int32_t
debugFlag
=
131
;
int32_t
debugFlag
=
131
;
int32_t
sDebugFlag
=
13
1
;
int32_t
sDebugFlag
=
13
5
;
// the maximum number of results for projection query on super table that are returned from
// the maximum number of results for projection query on super table that are returned from
// one virtual node, to order according to timestamp
// one virtual node, to order according to timestamp
...
@@ -1002,7 +1003,7 @@ static void doInitGlobalConfig() {
...
@@ -1002,7 +1003,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"dDebugFlag"
;
cfg
.
option
=
"dDebugFlag"
;
cfg
.
ptr
=
&
d
d
ebugFlag
;
cfg
.
ptr
=
&
d
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
;
cfg
.
minValue
=
0
;
cfg
.
minValue
=
0
;
...
...
src/cq/test/cqtest.c
浏览文件 @
c5032196
...
@@ -33,13 +33,13 @@ int main(int argc, char *argv[]) {
...
@@ -33,13 +33,13 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
d
d
ebugFlag
=
atoi
(
argv
[
++
i
]);
d
D
ebugFlag
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-n"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-n"
)
==
0
&&
i
<
argc
-
1
)
{
num
=
atoi
(
argv
[
++
i
]);
num
=
atoi
(
argv
[
++
i
]);
}
else
{
}
else
{
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
" [-n num]: number of streams, default:%d
\n
"
,
num
);
printf
(
" [-n num]: number of streams, default:%d
\n
"
,
num
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
d
d
ebugFlag
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
d
D
ebugFlag
);
printf
(
" [-h help]: print out this help
\n\n
"
);
printf
(
" [-h help]: print out this help
\n\n
"
);
exit
(
0
);
exit
(
0
);
}
}
...
...
src/dnode/inc/dnode
Log
.h
→
src/dnode/inc/dnode
Int
.h
浏览文件 @
c5032196
...
@@ -22,22 +22,12 @@ extern "C" {
...
@@ -22,22 +22,12 @@ extern "C" {
#include "tlog.h"
#include "tlog.h"
extern
int32_t
d
d
ebugFlag
;
extern
int32_t
d
D
ebugFlag
;
#define dError(...) \
#define dError(...) if (dDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR DND ", 255, __VA_ARGS__); }
if (ddebugFlag & DEBUG_ERROR) { \
#define dWarn(...) if (dDebugFlag & DEBUG_WARN) {taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); }
taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \
#define dTrace(...) if (dDebugFlag & DEBUG_TRACE) {taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); }
}
#define dPrint(...) {taosPrintLog("DND ", 255, __VA_ARGS__); }
#define dWarn(...) \
if (ddebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \
}
#define dTrace(...) \
if (ddebugFlag & DEBUG_TRACE) { \
taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \
}
#define dPrint(...) \
{ taosPrintLog("DND ", 255, __VA_ARGS__); }
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/dnode/inc/dnodeMgmt.h
浏览文件 @
c5032196
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
int32_t
dnodeInitMgmt
();
int32_t
dnodeInitMgmt
();
void
dnodeCleanupMgmt
();
void
dnodeCleanupMgmt
();
void
dnodeMgmt
(
SRpcMsg
*
rpcMsg
);
void
dnode
DispatchToDnode
Mgmt
(
SRpcMsg
*
rpcMsg
);
void
*
dnodeGetVnode
(
int32_t
vgId
);
void
*
dnodeGetVnode
(
int32_t
vgId
);
int32_t
dnodeGetVnodeStatus
(
void
*
pVnode
);
int32_t
dnodeGetVnodeStatus
(
void
*
pVnode
);
...
...
src/dnode/inc/dnodeRead.h
→
src/dnode/inc/dnode
V
Read.h
浏览文件 @
c5032196
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
int32_t
dnodeInitRead
();
int32_t
dnodeInitRead
();
void
dnodeCleanupRead
();
void
dnodeCleanupRead
();
void
dnode
Read
(
SRpcMsg
*
pMsg
);
void
dnode
DispatchToVnodeReadQueue
(
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/dnode/inc/dnodeWrite.h
→
src/dnode/inc/dnode
V
Write.h
浏览文件 @
c5032196
...
@@ -22,7 +22,7 @@ extern "C" {
...
@@ -22,7 +22,7 @@ extern "C" {
int32_t
dnodeInitWrite
();
int32_t
dnodeInitWrite
();
void
dnodeCleanupWrite
();
void
dnodeCleanupWrite
();
void
dnode
Writ
e
(
SRpcMsg
*
pMsg
);
void
dnode
DispatchToVnodeWriteQueu
e
(
SRpcMsg
*
pMsg
);
void
dnodeSendWriteResponse
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
void
dnodeSendWriteResponse
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
c5032196
...
@@ -22,13 +22,13 @@
...
@@ -22,13 +22,13 @@
#include "tconfig.h"
#include "tconfig.h"
#include "tglobal.h"
#include "tglobal.h"
#include "dnode.h"
#include "dnode.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
#include "dnodePeer.h"
#include "dnodePeer.h"
#include "dnodeModule.h"
#include "dnodeModule.h"
#include "dnodeRead.h"
#include "dnode
V
Read.h"
#include "dnodeShell.h"
#include "dnodeShell.h"
#include "dnodeWrite.h"
#include "dnode
V
Write.h"
#include "tgrant.h"
#include "tgrant.h"
static
int32_t
dnodeInitSystem
();
static
int32_t
dnodeInitSystem
();
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
c5032196
...
@@ -32,10 +32,10 @@
...
@@ -32,10 +32,10 @@
#include "dnode.h"
#include "dnode.h"
#include "vnode.h"
#include "vnode.h"
#include "mnode.h"
#include "mnode.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
#include "dnodeRead.h"
#include "dnode
V
Read.h"
#include "dnodeWrite.h"
#include "dnode
V
Write.h"
#include "dnodeModule.h"
#include "dnodeModule.h"
#define MPEER_CONTENT_LEN 2000
#define MPEER_CONTENT_LEN 2000
...
@@ -127,7 +127,7 @@ void dnodeCleanupMgmt() {
...
@@ -127,7 +127,7 @@ void dnodeCleanupMgmt() {
dnodeCloseVnodes
();
dnodeCloseVnodes
();
}
}
void
dnodeMgmt
(
SRpcMsg
*
pMsg
)
{
void
dnode
DispatchToDnode
Mgmt
(
SRpcMsg
*
pMsg
)
{
SRpcMsg
rsp
;
SRpcMsg
rsp
;
if
(
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])
{
if
(
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])
{
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
c5032196
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "mnode.h"
#include "mnode.h"
#include "http.h"
#include "http.h"
#include "monitor.h"
#include "monitor.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeModule.h"
#include "dnodeModule.h"
typedef
struct
{
typedef
struct
{
...
...
src/dnode/src/dnodePeer.c
浏览文件 @
c5032196
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
#include "tglobal.h"
#include "tglobal.h"
#include "trpc.h"
#include "trpc.h"
#include "dnode.h"
#include "dnode.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
#include "dnodeWrite.h"
#include "dnode
V
Write.h"
#include "mnode.h"
#include "mnode.h"
extern
void
dnodeUpdateIpSet
(
void
*
ahandle
,
SRpcIpSet
*
pIpSet
);
extern
void
dnodeUpdateIpSet
(
void
*
ahandle
,
SRpcIpSet
*
pIpSet
);
...
@@ -38,15 +38,15 @@ static void *tsDnodeServerRpc = NULL;
...
@@ -38,15 +38,15 @@ static void *tsDnodeServerRpc = NULL;
static
void
*
tsDnodeClientRpc
=
NULL
;
static
void
*
tsDnodeClientRpc
=
NULL
;
int32_t
dnodeInitServer
()
{
int32_t
dnodeInitServer
()
{
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_TABLE
]
=
dnode
Writ
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_TABLE
]
=
dnode
DispatchToVnodeWriteQueu
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_TABLE
]
=
dnode
Write
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_TABLE
]
=
dnode
DispatchToVnodeWriteQueue
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_TABLE
]
=
dnode
Writ
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_TABLE
]
=
dnode
DispatchToVnodeWriteQueu
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_STABLE
]
=
dnode
Writ
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_STABLE
]
=
dnode
DispatchToVnodeWriteQueu
e
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_VNODE
]
=
dnode
Mgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CREATE_VNODE
]
=
dnode
DispatchToDnodeMgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_VNODE
]
=
dnodeMgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_DROP_VNODE
]
=
dnode
DispatchToDnode
Mgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_STREAM
]
=
dnodeMgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_ALTER_STREAM
]
=
dnode
DispatchToDnode
Mgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CONFIG_DNODE
]
=
dnodeMgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MD_CONFIG_DNODE
]
=
dnode
DispatchToDnode
Mgmt
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_TABLE
]
=
mgmtProcessReqMsgFromDnode
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_TABLE
]
=
mgmtProcessReqMsgFromDnode
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_VNODE
]
=
mgmtProcessReqMsgFromDnode
;
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_DM_CONFIG_VNODE
]
=
mgmtProcessReqMsgFromDnode
;
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
c5032196
...
@@ -22,9 +22,9 @@
...
@@ -22,9 +22,9 @@
#include "tglobal.h"
#include "tglobal.h"
#include "http.h"
#include "http.h"
#include "dnode.h"
#include "dnode.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeRead.h"
#include "dnode
V
Read.h"
#include "dnodeWrite.h"
#include "dnode
V
Write.h"
#include "dnodeShell.h"
#include "dnodeShell.h"
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
...
@@ -37,9 +37,9 @@ static int32_t tsDnodeSubmitReqNum = 0;
...
@@ -37,9 +37,9 @@ static int32_t tsDnodeSubmitReqNum = 0;
void
mgmtProcessMsgFromShell
(
SRpcMsg
*
rpcMsg
);
void
mgmtProcessMsgFromShell
(
SRpcMsg
*
rpcMsg
);
int32_t
dnodeInitShell
()
{
int32_t
dnodeInitShell
()
{
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_SUBMIT
]
=
dnode
Writ
e
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_SUBMIT
]
=
dnode
DispatchToVnodeWriteQueu
e
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_QUERY
]
=
dnode
Read
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_QUERY
]
=
dnode
DispatchToVnodeReadQueue
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_FETCH
]
=
dnode
Read
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_FETCH
]
=
dnode
DispatchToVnodeReadQueue
;
// the following message shall be treated as mnode write
// the following message shall be treated as mnode write
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_CONNECT
]
=
mgmtProcessMsgFromShell
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_CM_CONNECT
]
=
mgmtProcessMsgFromShell
;
...
...
src/dnode/src/dnodeRead.c
→
src/dnode/src/dnode
V
Read.c
浏览文件 @
c5032196
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
#include "trpc.h"
#include "trpc.h"
#include "twal.h"
#include "twal.h"
#include "tglobal.h"
#include "tglobal.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
#include "dnodeRead.h"
#include "dnode
V
Read.h"
#include "vnode.h"
#include "vnode.h"
typedef
struct
{
typedef
struct
{
...
@@ -84,7 +84,7 @@ void dnodeCleanupRead() {
...
@@ -84,7 +84,7 @@ void dnodeCleanupRead() {
dPrint
(
"dnode read is closed"
);
dPrint
(
"dnode read is closed"
);
}
}
void
dnode
Read
(
SRpcMsg
*
pMsg
)
{
void
dnode
DispatchToVnodeReadQueue
(
SRpcMsg
*
pMsg
)
{
int32_t
queuedMsgNum
=
0
;
int32_t
queuedMsgNum
=
0
;
int32_t
leftLen
=
pMsg
->
contLen
;
int32_t
leftLen
=
pMsg
->
contLen
;
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
...
...
src/dnode/src/dnodeWrite.c
→
src/dnode/src/dnode
V
Write.c
浏览文件 @
c5032196
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
#include "tglobal.h"
#include "tglobal.h"
#include "vnode.h"
#include "vnode.h"
#include "tdataformat.h"
#include "tdataformat.h"
#include "dnode
Log
.h"
#include "dnode
Int
.h"
#include "dnodeWrite.h"
#include "dnode
V
Write.h"
#include "dnodeMgmt.h"
#include "dnodeMgmt.h"
typedef
struct
{
typedef
struct
{
...
@@ -82,7 +82,7 @@ void dnodeCleanupWrite() {
...
@@ -82,7 +82,7 @@ void dnodeCleanupWrite() {
dPrint
(
"dnode write is closed"
);
dPrint
(
"dnode write is closed"
);
}
}
void
dnode
Writ
e
(
SRpcMsg
*
pMsg
)
{
void
dnode
DispatchToVnodeWriteQueu
e
(
SRpcMsg
*
pMsg
)
{
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
char
*
pCont
=
(
char
*
)
pMsg
->
pCont
;
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_MD_DROP_STABLE
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_SUBMIT
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_MD_DROP_STABLE
)
{
...
...
src/rpc/test/rserver.c
浏览文件 @
c5032196
...
@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) {
...
@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) {
commit
=
atoi
(
argv
[
++
i
]);
commit
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
rpcDebugFlag
=
atoi
(
argv
[
++
i
]);
rpcDebugFlag
=
atoi
(
argv
[
++
i
]);
d
d
ebugFlag
=
rpcDebugFlag
;
d
D
ebugFlag
=
rpcDebugFlag
;
uDebugFlag
=
rpcDebugFlag
;
uDebugFlag
=
rpcDebugFlag
;
}
else
{
}
else
{
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
...
...
src/vnode/inc/vnodeInt.h
浏览文件 @
c5032196
...
@@ -20,8 +20,17 @@
...
@@ -20,8 +20,17 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include "tlog.h"
#include "tsync.h"
#include "tsync.h"
#include "twal.h"
#include "twal.h"
#include "tcq.h"
extern
int32_t
vDebugFlag
;
#define vError(...) if (vDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR VND ", 255, __VA_ARGS__); }
#define vWarn(...) if (vDebugFlag & DEBUG_WARN) {taosPrintLog("WARN VND ", vDebugFlag, __VA_ARGS__); }
#define vTrace(...) if (vDebugFlag & DEBUG_TRACE) {taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); }
#define vPrint(...) {taosPrintLog("VND ", 255, __VA_ARGS__); }
typedef
struct
{
typedef
struct
{
int32_t
vgId
;
// global vnode group ID
int32_t
vgId
;
// global vnode group ID
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
c5032196
此差异已折叠。
点击以展开。
src/vnode/src/vnodeRead.c
浏览文件 @
c5032196
...
@@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
...
@@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
pRet
->
len
=
sizeof
(
SQueryTableRsp
);
pRet
->
len
=
sizeof
(
SQueryTableRsp
);
pRet
->
rsp
=
pRsp
;
pRet
->
rsp
=
pRsp
;
dTrace
(
"pVnode:%p vgId:%d QInfo:%p, dnode query msg disposed"
,
pVnode
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d QInfo:%p, dnode query msg disposed"
,
pVnode
->
vgId
,
pQInfo
);
}
else
{
}
else
{
pQInfo
=
pCont
;
pQInfo
=
pCont
;
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
...
@@ -83,7 +83,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
...
@@ -83,7 +83,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
dTrace
(
"pVnode:%p vgId:%d QInfo:%p, retrieve msg is received"
,
pVnode
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d QInfo:%p, retrieve msg is received"
,
pVnode
->
vgId
,
pQInfo
);
pRet
->
code
=
qRetrieveQueryResultInfo
(
pQInfo
);
pRet
->
code
=
qRetrieveQueryResultInfo
(
pQInfo
);
if
(
pRet
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pRet
->
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -104,6 +104,6 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
...
@@ -104,6 +104,6 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t cont
}
}
}
}
dTrace
(
"pVnode:%p vgId:%d QInfo:%p, retrieve msg is disposed"
,
pVnode
,
pVnode
->
vgId
,
pQInfo
);
vTrace
(
"vgId:%d QInfo:%p, retrieve msg is disposed"
,
pVnode
->
vgId
,
pQInfo
);
return
code
;
return
code
;
}
}
src/vnode/src/vnodeWrite.c
浏览文件 @
c5032196
...
@@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
...
@@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
// save insert result into item
// save insert result into item
dTrace
(
"pVnode:%p vgId:%d, submit msg is processed"
,
pVnode
,
pVnode
->
vgId
);
vTrace
(
"vgId:%d, submit msg is processed"
,
pVnode
->
vgId
);
code
=
tsdbInsertData
(
pVnode
->
tsdb
,
pCont
);
code
=
tsdbInsertData
(
pVnode
->
tsdb
,
pCont
);
pRet
->
len
=
sizeof
(
SShellSubmitRspMsg
);
pRet
->
len
=
sizeof
(
SShellSubmitRspMsg
);
...
@@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
...
@@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
SMDCreateTableMsg
*
pTable
=
pCont
;
SMDCreateTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
int32_t
code
=
0
;
dTrace
(
"pVnode:%p vgId:%d, table:%s, start to create"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
);
vTrace
(
"vgId:%d, table:%s, start to create"
,
pVnode
->
vgId
,
pTable
->
tableId
);
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
...
@@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
...
@@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
tfree
(
pDestTagSchema
);
tfree
(
pDestTagSchema
);
tfree
(
pDestSchema
);
tfree
(
pDestSchema
);
dTrace
(
"pVnode:%p vgId:%d, table:%s is created, result:%x"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
,
code
);
vTrace
(
"vgId:%d, table:%s is created, result:%x"
,
pVnode
->
vgId
,
pTable
->
tableId
,
code
);
return
code
;
return
code
;
}
}
...
@@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
...
@@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDDropTableMsg
*
pTable
=
pCont
;
SMDDropTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
int32_t
code
=
0
;
dTrace
(
"pVnode:%p vgId:%d, table:%s, start to drop"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
);
vTrace
(
"vgId:%d, table:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
tableId
);
STableId
tableId
=
{
STableId
tableId
=
{
.
uid
=
htobe64
(
pTable
->
uid
),
.
uid
=
htobe64
(
pTable
->
uid
),
.
tid
=
htonl
(
pTable
->
sid
)
.
tid
=
htonl
(
pTable
->
sid
)
...
@@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
...
@@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDCreateTableMsg
*
pTable
=
pCont
;
SMDCreateTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
int32_t
code
=
0
;
dTrace
(
"pVnode:%p vgId:%d, table:%s, start to alter"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
);
vTrace
(
"vgId:%d, table:%s, start to alter"
,
pVnode
->
vgId
,
pTable
->
tableId
);
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
...
@@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
...
@@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
tfree
(
pDestSchema
);
tfree
(
pDestSchema
);
dTrace
(
"pVnode:%p vgId:%d, table:%s, alter table result:%d"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
,
code
);
vTrace
(
"vgId:%d, table:%s, alter table result:%d"
,
pVnode
->
vgId
,
pTable
->
tableId
,
code
);
return
code
;
return
code
;
}
}
...
@@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
...
@@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDDropSTableMsg
*
pTable
=
pCont
;
SMDDropSTableMsg
*
pTable
=
pCont
;
int32_t
code
=
0
;
int32_t
code
=
0
;
dTrace
(
"pVnode:%p vgId:%d, stable:%s, start to drop"
,
pVnode
,
pVnode
->
vgId
,
pTable
->
tableId
);
vTrace
(
"vgId:%d, stable:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
tableId
);
// TODO: drop stable in vvnode
// TODO: drop stable in vvnode
//int64_t uid = htobe64(pTable->uid);
//int64_t uid = htobe64(pTable->uid);
//void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode);
//void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode);
//rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid);
//rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid);
code
=
TSDB_CODE_SUCCESS
;
code
=
TSDB_CODE_SUCCESS
;
dTrace
(
"pVnode:%p
vgId:%d, stable:%s, drop stable result:%x"
,
pVnode
,
pTable
->
tableId
,
code
);
vTrace
(
"
vgId:%d, stable:%s, drop stable result:%x"
,
pVnode
,
pTable
->
tableId
,
code
);
return
code
;
return
code
;
}
}
...
...
src/wal/test/waltest.c
浏览文件 @
c5032196
...
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
...
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
}
else
if
(
strcmp
(
argv
[
i
],
"-v"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-v"
)
==
0
&&
i
<
argc
-
1
)
{
ver
=
atoll
(
argv
[
++
i
]);
ver
=
atoll
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-d"
)
==
0
&&
i
<
argc
-
1
)
{
d
d
ebugFlag
=
atoi
(
argv
[
++
i
]);
d
D
ebugFlag
=
atoi
(
argv
[
++
i
]);
}
else
{
}
else
{
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
" [-p path]: wal file path default is:%s
\n
"
,
path
);
printf
(
" [-p path]: wal file path default is:%s
\n
"
,
path
);
...
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
...
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
printf
(
" [-r rows]: rows of records per wal file, default is:%d
\n
"
,
rows
);
printf
(
" [-r rows]: rows of records per wal file, default is:%d
\n
"
,
rows
);
printf
(
" [-k keep]: keep the wal after closing, default is:%d
\n
"
,
keep
);
printf
(
" [-k keep]: keep the wal after closing, default is:%d
\n
"
,
keep
);
printf
(
" [-v version]: initial version, default is:%ld
\n
"
,
ver
);
printf
(
" [-v version]: initial version, default is:%ld
\n
"
,
ver
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
d
d
ebugFlag
);
printf
(
" [-d debugFlag]: debug flag, default:%d
\n
"
,
d
D
ebugFlag
);
printf
(
" [-h help]: print out this help
\n\n
"
);
printf
(
" [-h help]: print out this help
\n\n
"
);
exit
(
0
);
exit
(
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录