Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e4e86609
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看板
提交
e4e86609
编写于
11月 06, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1915
上级
4bc9284a
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
141 addition
and
139 deletion
+141
-139
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/dnodePeer.c
src/dnode/src/dnodePeer.c
+1
-0
src/inc/mnode.h
src/inc/mnode.h
+8
-8
src/inc/taosdef.h
src/inc/taosdef.h
+29
-28
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+4
-4
src/mnode/inc/mnodeTable.h
src/mnode/inc/mnodeTable.h
+2
-2
src/mnode/inc/mnodeVgroup.h
src/mnode/inc/mnodeVgroup.h
+2
-2
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+87
-87
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+3
-3
src/plugins/http/src/httpQueue.c
src/plugins/http/src/httpQueue.c
+1
-1
未找到文件。
src/dnode/src/dnodeMPeer.c
浏览文件 @
e4e86609
...
@@ -128,7 +128,7 @@ void dnodeDispatchToMPeerQueue(SRpcMsg *pMsg) {
...
@@ -128,7 +128,7 @@ void dnodeDispatchToMPeerQueue(SRpcMsg *pMsg) {
return
;
return
;
}
}
SMnodeMsg
*
pPeer
=
(
SMnodeMsg
*
)
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
SMnodeMsg
*
pPeer
=
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
mnodeCreateMsg
(
pPeer
,
pMsg
);
mnodeCreateMsg
(
pPeer
,
pMsg
);
taosWriteQitem
(
tsMPeerQueue
,
TAOS_QTYPE_RPC
,
pPeer
);
taosWriteQitem
(
tsMPeerQueue
,
TAOS_QTYPE_RPC
,
pPeer
);
}
}
...
...
src/dnode/src/dnodeMRead.c
浏览文件 @
e4e86609
...
@@ -129,7 +129,7 @@ void dnodeDispatchToMReadQueue(SRpcMsg *pMsg) {
...
@@ -129,7 +129,7 @@ void dnodeDispatchToMReadQueue(SRpcMsg *pMsg) {
return
;
return
;
}
}
SMnodeMsg
*
pRead
=
(
SMnodeMsg
*
)
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
SMnodeMsg
*
pRead
=
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
mnodeCreateMsg
(
pRead
,
pMsg
);
mnodeCreateMsg
(
pRead
,
pMsg
);
taosWriteQitem
(
tsMReadQueue
,
TAOS_QTYPE_RPC
,
pRead
);
taosWriteQitem
(
tsMReadQueue
,
TAOS_QTYPE_RPC
,
pRead
);
}
}
...
...
src/dnode/src/dnodeMWrite.c
浏览文件 @
e4e86609
...
@@ -129,7 +129,7 @@ void dnodeDispatchToMWriteQueue(SRpcMsg *pMsg) {
...
@@ -129,7 +129,7 @@ void dnodeDispatchToMWriteQueue(SRpcMsg *pMsg) {
return
;
return
;
}
}
SMnodeMsg
*
pWrite
=
(
SMnodeMsg
*
)
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
SMnodeMsg
*
pWrite
=
taosAllocateQitem
(
sizeof
(
SMnodeMsg
));
mnodeCreateMsg
(
pWrite
,
pMsg
);
mnodeCreateMsg
(
pWrite
,
pMsg
);
dDebug
(
"app:%p:%p, msg:%s is put into mwrite queue:%p"
,
pWrite
->
rpcMsg
.
ahandle
,
pWrite
,
dDebug
(
"app:%p:%p, msg:%s is put into mwrite queue:%p"
,
pWrite
->
rpcMsg
.
ahandle
,
pWrite
,
...
...
src/dnode/src/dnodePeer.c
浏览文件 @
e4e86609
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
* to dnode. All theses messages are handled from here
* to dnode. All theses messages are handled from here
*/
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "tglobal.h"
#include "tglobal.h"
...
...
src/inc/mnode.h
浏览文件 @
e4e86609
...
@@ -35,7 +35,13 @@ typedef struct {
...
@@ -35,7 +35,13 @@ typedef struct {
}
SMnodeRsp
;
}
SMnodeRsp
;
typedef
struct
SMnodeMsg
{
typedef
struct
SMnodeMsg
{
SRpcMsg
rpcMsg
;
struct
SAcctObj
*
pAcct
;
struct
SDnodeObj
*
pDnode
;
struct
SUserObj
*
pUser
;
struct
SDbObj
*
pDb
;
struct
SVgObj
*
pVgroup
;
struct
STableObj
*
pTable
;
struct
SSTableObj
*
pSTable
;
SMnodeRsp
rpcRsp
;
SMnodeRsp
rpcRsp
;
int8_t
received
;
int8_t
received
;
int8_t
successed
;
int8_t
successed
;
...
@@ -43,13 +49,7 @@ typedef struct SMnodeMsg {
...
@@ -43,13 +49,7 @@ typedef struct SMnodeMsg {
int8_t
retry
;
int8_t
retry
;
int32_t
code
;
int32_t
code
;
void
*
pObj
;
void
*
pObj
;
struct
SAcctObj
*
pAcct
;
SRpcMsg
rpcMsg
;
struct
SDnodeObj
*
pDnode
;
struct
SUserObj
*
pUser
;
struct
SDbObj
*
pDb
;
struct
SVgObj
*
pVgroup
;
struct
STableObj
*
pTable
;
struct
SSuperTableObj
*
pSTable
;
}
SMnodeMsg
;
}
SMnodeMsg
;
void
mnodeCreateMsg
(
SMnodeMsg
*
pMsg
,
SRpcMsg
*
rpcMsg
);
void
mnodeCreateMsg
(
SMnodeMsg
*
pMsg
,
SRpcMsg
*
rpcMsg
);
...
...
src/inc/taosdef.h
浏览文件 @
e4e86609
...
@@ -424,42 +424,43 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
...
@@ -424,42 +424,43 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size, void* buf
#define TSDB_PORT_DNODEDNODE 5
#define TSDB_PORT_DNODEDNODE 5
#define TSDB_PORT_SYNC 10
#define TSDB_PORT_SYNC 10
#define TSDB_PORT_HTTP 11
#define TSDB_PORT_HTTP 11
#define TSDB_PORT_ARBITRATOR 12
#define TSDB_PORT_ARBITRATOR 12
#define TAOS_QTYPE_RPC 0
typedef
enum
{
#define TAOS_QTYPE_FWD 1
TAOS_QTYPE_RPC
=
0
,
#define TAOS_QTYPE_WAL 2
TAOS_QTYPE_FWD
=
1
,
#define TAOS_QTYPE_CQ 3
TAOS_QTYPE_WAL
=
2
,
#define TAOS_QTYPE_QUERY 4
TAOS_QTYPE_CQ
=
3
,
TAOS_QTYPE_QUERY
=
4
}
EQType
;
typedef
enum
{
typedef
enum
{
TSDB_SUPER_TABLE
=
0
,
// super table
TSDB_SUPER_TABLE
=
0
,
// super table
TSDB_CHILD_TABLE
=
1
,
// table created from super table
TSDB_CHILD_TABLE
=
1
,
// table created from super table
TSDB_NORMAL_TABLE
=
2
,
// ordinary table
TSDB_NORMAL_TABLE
=
2
,
// ordinary table
TSDB_STREAM_TABLE
=
3
,
// table created from stream computing
TSDB_STREAM_TABLE
=
3
,
// table created from stream computing
TSDB_TABLE_MAX
=
4
TSDB_TABLE_MAX
=
4
}
ETableType
;
}
ETableType
;
typedef
enum
{
typedef
enum
{
TSDB_MOD_MNODE
,
TSDB_MOD_MNODE
=
0
,
TSDB_MOD_HTTP
,
TSDB_MOD_HTTP
=
1
,
TSDB_MOD_MONITOR
,
TSDB_MOD_MONITOR
=
2
,
TSDB_MOD_MQTT
,
TSDB_MOD_MQTT
=
3
,
TSDB_MOD_MAX
TSDB_MOD_MAX
=
4
}
EModuleType
;
}
EModuleType
;
typedef
enum
{
typedef
enum
{
TSDB_CHECK_ITEM_NETWORK
,
TSDB_CHECK_ITEM_NETWORK
,
TSDB_CHECK_ITEM_MEM
,
TSDB_CHECK_ITEM_MEM
,
TSDB_CHECK_ITEM_CPU
,
TSDB_CHECK_ITEM_CPU
,
TSDB_CHECK_ITEM_DISK
,
TSDB_CHECK_ITEM_DISK
,
TSDB_CHECK_ITEM_OS
,
TSDB_CHECK_ITEM_OS
,
TSDB_CHECK_ITEM_ACCESS
,
TSDB_CHECK_ITEM_ACCESS
,
TSDB_CHECK_ITEM_VERSION
,
TSDB_CHECK_ITEM_VERSION
,
TSDB_CHECK_ITEM_DATAFILE
,
TSDB_CHECK_ITEM_DATAFILE
,
TSDB_CHECK_ITEM_MAX
TSDB_CHECK_ITEM_MAX
}
ECheckItemType
;
}
ECheckItemType
;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
e4e86609
...
@@ -89,7 +89,7 @@ typedef struct STableObj {
...
@@ -89,7 +89,7 @@ typedef struct STableObj {
int8_t
type
;
int8_t
type
;
}
STableObj
;
}
STableObj
;
typedef
struct
SS
uper
TableObj
{
typedef
struct
SSTableObj
{
STableObj
info
;
STableObj
info
;
int8_t
reserved0
[
9
];
// for fill struct STableObj to 4byte align
int8_t
reserved0
[
9
];
// for fill struct STableObj to 4byte align
int16_t
nextColId
;
int16_t
nextColId
;
...
@@ -104,7 +104,7 @@ typedef struct SSuperTableObj {
...
@@ -104,7 +104,7 @@ typedef struct SSuperTableObj {
int32_t
numOfTables
;
int32_t
numOfTables
;
SSchema
*
schema
;
SSchema
*
schema
;
void
*
vgHash
;
void
*
vgHash
;
}
SS
uper
TableObj
;
}
SSTableObj
;
typedef
struct
{
typedef
struct
{
STableObj
info
;
STableObj
info
;
...
@@ -122,8 +122,8 @@ typedef struct {
...
@@ -122,8 +122,8 @@ typedef struct {
int32_t
refCount
;
int32_t
refCount
;
char
*
sql
;
//used by normal table
char
*
sql
;
//used by normal table
SSchema
*
schema
;
//used by normal table
SSchema
*
schema
;
//used by normal table
SS
uperTableObj
*
superTable
;
SS
TableObj
*
superTable
;
}
SC
hild
TableObj
;
}
SCTableObj
;
typedef
struct
{
typedef
struct
{
int32_t
dnodeId
;
int32_t
dnodeId
;
...
...
src/mnode/inc/mnodeTable.h
浏览文件 @
e4e86609
...
@@ -29,8 +29,8 @@ int64_t mnodeGetChildTableNum();
...
@@ -29,8 +29,8 @@ int64_t mnodeGetChildTableNum();
void
*
mnodeGetTable
(
char
*
tableId
);
void
*
mnodeGetTable
(
char
*
tableId
);
void
mnodeIncTableRef
(
void
*
pTable
);
void
mnodeIncTableRef
(
void
*
pTable
);
void
mnodeDecTableRef
(
void
*
pTable
);
void
mnodeDecTableRef
(
void
*
pTable
);
void
*
mnodeGetNextChildTable
(
void
*
pIter
,
SC
hild
TableObj
**
pTable
);
void
*
mnodeGetNextChildTable
(
void
*
pIter
,
SCTableObj
**
pTable
);
void
*
mnodeGetNextSuperTable
(
void
*
pIter
,
SS
uper
TableObj
**
pTable
);
void
*
mnodeGetNextSuperTable
(
void
*
pIter
,
SSTableObj
**
pTable
);
void
mnodeDropAllChildTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllChildTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllSuperTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllSuperTables
(
SDbObj
*
pDropDb
);
void
mnodeDropAllChildTablesInVgroups
(
SVgObj
*
pVgroup
);
void
mnodeDropAllChildTablesInVgroups
(
SVgObj
*
pVgroup
);
...
...
src/mnode/inc/mnodeVgroup.h
浏览文件 @
e4e86609
...
@@ -43,8 +43,8 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle);
...
@@ -43,8 +43,8 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle);
void
mnodeAlterVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeAlterVgroup
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
int32_t
mnodeGetAvailableVgroup
(
struct
SMnodeMsg
*
pMsg
,
SVgObj
**
pVgroup
,
int32_t
*
sid
);
int32_t
mnodeGetAvailableVgroup
(
struct
SMnodeMsg
*
pMsg
,
SVgObj
**
pVgroup
,
int32_t
*
sid
);
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SC
hild
TableObj
*
pTable
);
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SCTableObj
*
pTable
);
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SC
hild
TableObj
*
pTable
);
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SCTableObj
*
pTable
);
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpcEpSet
*
epSet
,
void
*
ahandle
);
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpcEpSet
*
epSet
,
void
*
ahandle
);
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
);
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
);
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
e4e86609
...
@@ -1043,7 +1043,7 @@ void sdbFreeWritequeue() {
...
@@ -1043,7 +1043,7 @@ void sdbFreeWritequeue() {
int32_t
sdbWriteToQueue
(
void
*
param
,
void
*
data
,
int32_t
qtype
,
void
*
pMsg
)
{
int32_t
sdbWriteToQueue
(
void
*
param
,
void
*
data
,
int32_t
qtype
,
void
*
pMsg
)
{
SWalHead
*
pHead
=
data
;
SWalHead
*
pHead
=
data
;
int32_t
size
=
sizeof
(
SWalHead
)
+
pHead
->
len
;
int32_t
size
=
sizeof
(
SWalHead
)
+
pHead
->
len
;
SWalHead
*
pWal
=
(
SWalHead
*
)
taosAllocateQitem
(
size
);
SWalHead
*
pWal
=
taosAllocateQitem
(
size
);
memcpy
(
pWal
,
pHead
,
size
);
memcpy
(
pWal
,
pHead
,
size
);
taosWriteQitem
(
tsSdbWriteQueue
,
qtype
,
pWal
);
taosWriteQitem
(
tsSdbWriteQueue
,
qtype
,
pWal
);
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
e4e86609
此差异已折叠。
点击以展开。
src/mnode/src/mnodeVgroup.c
浏览文件 @
e4e86609
...
@@ -694,7 +694,7 @@ static bool mnodeFilterVgroups(SVgObj *pVgroup, STableObj *pTable) {
...
@@ -694,7 +694,7 @@ static bool mnodeFilterVgroups(SVgObj *pVgroup, STableObj *pTable) {
return
true
;
return
true
;
}
}
SC
hildTableObj
*
pCTable
=
(
SChild
TableObj
*
)
pTable
;
SC
TableObj
*
pCTable
=
(
SC
TableObj
*
)
pTable
;
if
(
pVgroup
->
vgId
==
pCTable
->
vgId
)
{
if
(
pVgroup
->
vgId
==
pCTable
->
vgId
)
{
return
true
;
return
true
;
}
else
{
}
else
{
...
@@ -791,7 +791,7 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
...
@@ -791,7 +791,7 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
return
numOfRows
;
return
numOfRows
;
}
}
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SC
hild
TableObj
*
pTable
)
{
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SCTableObj
*
pTable
)
{
int32_t
idPoolSize
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
int32_t
idPoolSize
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
if
(
pTable
->
tid
>
idPoolSize
)
{
if
(
pTable
->
tid
>
idPoolSize
)
{
mnodeAllocVgroupIdPool
(
pVgroup
);
mnodeAllocVgroupIdPool
(
pVgroup
);
...
@@ -807,7 +807,7 @@ void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable) {
...
@@ -807,7 +807,7 @@ void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SChildTableObj *pTable) {
}
}
}
}
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SC
hild
TableObj
*
pTable
)
{
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SCTableObj
*
pTable
)
{
if
(
pTable
->
tid
>=
1
)
{
if
(
pTable
->
tid
>=
1
)
{
taosFreeId
(
pVgroup
->
idPool
,
pTable
->
tid
);
taosFreeId
(
pVgroup
->
idPool
,
pTable
->
tid
);
pVgroup
->
numOfTables
--
;
pVgroup
->
numOfTables
--
;
...
...
src/plugins/http/src/httpQueue.c
浏览文件 @
e4e86609
...
@@ -49,7 +49,7 @@ static taos_queue tsHttpQueue;
...
@@ -49,7 +49,7 @@ static taos_queue tsHttpQueue;
void
httpDispatchToResultQueue
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
numOfRows
,
void
(
*
fp
)(
void
*
param
,
void
*
result
,
int32_t
numOfRows
))
{
void
httpDispatchToResultQueue
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
numOfRows
,
void
(
*
fp
)(
void
*
param
,
void
*
result
,
int32_t
numOfRows
))
{
if
(
tsHttpQueue
!=
NULL
)
{
if
(
tsHttpQueue
!=
NULL
)
{
SHttpResult
*
pMsg
=
(
SHttpResult
*
)
taosAllocateQitem
(
sizeof
(
SHttpResult
));
SHttpResult
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SHttpResult
));
pMsg
->
param
=
param
;
pMsg
->
param
=
param
;
pMsg
->
result
=
result
;
pMsg
->
result
=
result
;
pMsg
->
numOfRows
=
numOfRows
;
pMsg
->
numOfRows
=
numOfRows
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录