Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
05613886
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
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看板
未验证
提交
05613886
编写于
10月 26, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
10月 26, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8431 from taosdata/feature/dnode3
Feature/dnode3
上级
cf0ad02d
38f6f3b0
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
981 addition
and
1047 deletion
+981
-1047
source/server/dnode/src/dnodeMsg.c
source/server/dnode/src/dnodeMsg.c
+3
-3
source/server/vnode/CMakeLists.txt
source/server/vnode/CMakeLists.txt
+1
-0
source/server/vnode/inc/vnodeInt.h
source/server/vnode/inc/vnodeInt.h
+45
-49
source/server/vnode/inc/vnodeMain.h
source/server/vnode/inc/vnodeMain.h
+0
-48
source/server/vnode/src/vnodeInt.c
source/server/vnode/src/vnodeInt.c
+912
-15
source/server/vnode/src/vnodeMain.c
source/server/vnode/src/vnodeMain.c
+0
-915
source/server/vnode/src/vnodeMgmt.c
source/server/vnode/src/vnodeMgmt.c
+1
-1
source/server/vnode/src/vnodeMgmtMsg.c
source/server/vnode/src/vnodeMgmtMsg.c
+1
-1
source/server/vnode/src/vnodeRead.c
source/server/vnode/src/vnodeRead.c
+3
-3
source/server/vnode/src/vnodeReadMsg.c
source/server/vnode/src/vnodeReadMsg.c
+5
-5
source/server/vnode/src/vnodeVersion.c
source/server/vnode/src/vnodeVersion.c
+5
-2
source/server/vnode/src/vnodeWorker.c
source/server/vnode/src/vnodeWorker.c
+1
-1
source/server/vnode/src/vnodeWrite.c
source/server/vnode/src/vnodeWrite.c
+4
-4
未找到文件。
source/server/dnode/src/dnodeMsg.c
浏览文件 @
05613886
...
@@ -14,12 +14,12 @@
...
@@ -14,12 +14,12 @@
*/
*/
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "tthread.h"
#include "dnodeEps.h"
#include "dnodeMsg.h"
#include "dnodeMsg.h"
#include "dnodeEps.h"
#include "mnode.h"
#include "mnode.h"
#include "
vnode
.h"
#include "
tthread
.h"
#include "ttime.h"
#include "ttime.h"
#include "vnode.h"
static
struct
{
static
struct
{
pthread_t
*
threadId
;
pthread_t
*
threadId
;
...
...
source/server/vnode/CMakeLists.txt
浏览文件 @
05613886
...
@@ -16,6 +16,7 @@ target_link_libraries(
...
@@ -16,6 +16,7 @@ target_link_libraries(
PUBLIC tq
PUBLIC tq
PUBLIC tsdb
PUBLIC tsdb
PUBLIC wal
PUBLIC wal
PUBLIC sync
PUBLIC cjson
PUBLIC cjson
)
)
...
...
source/server/vnode/inc/vnodeInt.h
浏览文件 @
05613886
...
@@ -16,18 +16,19 @@
...
@@ -16,18 +16,19 @@
#ifndef _TD_VNODE_INT_H_
#ifndef _TD_VNODE_INT_H_
#define _TD_VNODE_INT_H_
#define _TD_VNODE_INT_H_
#include "os.h"
#include "amalloc.h"
#include "amalloc.h"
#include "meta.h"
#include "meta.h"
#include "os.h"
#include "sync.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "tlog.h"
#include "tq.h"
#include "tq.h"
#include "tqueue.h"
#include "trpc.h"
#include "trpc.h"
#include "tsdb.h"
#include "tsdb.h"
#include "tworker.h"
#include "vnode.h"
#include "vnode.h"
#include "tlog.h"
#include "tqueue.h"
#include "wal.h"
#include "wal.h"
#include "tworker.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -43,51 +44,28 @@ extern int32_t vDebugFlag;
...
@@ -43,51 +44,28 @@ extern int32_t vDebugFlag;
#define vTrace(...) { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); }}
#define vTrace(...) { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); }}
typedef
struct
{
typedef
struct
{
SMeta
*
pMeta
;
int32_t
vgId
;
// global vnode group ID
STsdb
*
pTsdb
;
int32_t
refCount
;
// reference count
STQ
*
pTQ
;
SMemAllocator
*
allocator
;
SMemAllocator
*
allocator
;
SMeta
*
pMeta
;
STsdb
*
pTsdb
;
int32_t
vgId
;
// global vnode group ID
STQ
*
pTQ
;
int32_t
refCount
;
// reference count
twalh
pWal
;
int64_t
queuedWMsgSize
;
SyncNodeId
syncNode
;
int32_t
queuedWMsg
;
taos_queue
pWriteQ
;
// write queue
int32_t
queuedRMsg
;
taos_queue
pQueryQ
;
// read query queue
int32_t
numOfExistQHandle
;
// current initialized and existed query handle in current dnode
taos_queue
pFetchQ
;
// read fetch/cancel queue
int32_t
flowctrlLevel
;
SWalCfg
walCfg
;
int8_t
preClose
;
// drop and close switch
SSyncCluster
syncCfg
;
int8_t
reserved
[
3
];
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
];
int64_t
sequence
;
// for topic
int64_t
queuedWMsgSize
;
int8_t
status
;
int32_t
queuedWMsg
;
int8_t
role
;
int32_t
queuedRMsg
;
int8_t
accessState
;
int32_t
numOfQHandle
;
// current initialized and existed query handle in current dnode
int8_t
isFull
;
int8_t
status
;
int8_t
isCommiting
;
int8_t
role
;
int8_t
dbReplica
;
int8_t
accessState
;
int8_t
dropped
;
int8_t
dropped
;
int8_t
dbType
;
uint64_t
version
;
// current version
uint64_t
cversion
;
// version while commit start
uint64_t
fversion
;
// version on saved data file
void
*
wqueue
;
// write queue
void
*
qqueue
;
// read query queue
void
*
fqueue
;
// read fetch/cancel queue
void
*
wal
;
void
*
tsdb
;
int64_t
sync
;
void
*
events
;
void
*
cq
;
// continuous query
int32_t
dbCfgVersion
;
int32_t
vgCfgVersion
;
// STsdbCfg tsdbCfg;
#if 0
SSyncCfg syncCfg;
#endif
SWalCfg
walCfg
;
void
*
qMgmt
;
char
*
rootDir
;
tsem_t
sem
;
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
];
pthread_mutex_t
statusMutex
;
pthread_mutex_t
statusMutex
;
}
SVnode
;
}
SVnode
;
...
@@ -97,8 +75,26 @@ typedef struct {
...
@@ -97,8 +75,26 @@ typedef struct {
void
*
qhandle
;
// used by query and retrieve msg
void
*
qhandle
;
// used by query and retrieve msg
}
SVnRsp
;
}
SVnRsp
;
void
vnodeSendMsgToDnode
(
struct
SRpcEpSet
*
epSet
,
struct
SRpcMsg
*
rpcMsg
);
void
vnodeSendMsgToMnode
(
struct
SRpcMsg
*
rpcMsg
);
void
vnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
void
vnodeGetDnodeEp
(
int32_t
dnodeId
,
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
int32_t
vnodeCreate
(
SCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeDrop
(
int32_t
vgId
);
int32_t
vnodeOpen
(
int32_t
vgId
);
int32_t
vnodeAlter
(
SVnode
*
pVnode
,
SCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeSync
(
int32_t
vgId
);
int32_t
vnodeClose
(
int32_t
vgId
);
void
vnodeCleanUp
(
SVnode
*
pVnode
);
void
vnodeDestroy
(
SVnode
*
pVnode
);
int32_t
vnodeCompact
(
int32_t
vgId
);
void
vnodeBackup
(
int32_t
vgId
);
void
vnodeGetStatus
(
struct
SStatusMsg
*
status
);
SVnode
*
vnodeAcquire
(
int32_t
vgId
);
SVnode
*
vnodeAcquireNotClose
(
int32_t
vgId
);
void
vnodeRelease
(
SVnode
*
pVnode
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
source/server/vnode/inc/vnodeMain.h
已删除
100644 → 0
浏览文件 @
cf0ad02d
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_VNODE_MAIN_H_
#define _TD_VNODE_MAIN_H_
#include "vnodeInt.h"
#ifdef __cplusplus
extern
"C"
{
#endif
int32_t
vnodeInitMain
();
void
vnodeCleanupMain
();
int32_t
vnodeCreate
(
SCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeDrop
(
int32_t
vgId
);
int32_t
vnodeOpen
(
int32_t
vgId
);
int32_t
vnodeAlter
(
SVnode
*
pVnode
,
SCreateVnodeMsg
*
pVnodeCfg
);
int32_t
vnodeSync
(
int32_t
vgId
);
int32_t
vnodeClose
(
int32_t
vgId
);
void
vnodeCleanUp
(
SVnode
*
pVnode
);
void
vnodeDestroy
(
SVnode
*
pVnode
);
int32_t
vnodeCompact
(
int32_t
vgId
);
void
vnodeBackup
(
int32_t
vgId
);
void
vnodeGetStatus
(
struct
SStatusMsg
*
status
);
SVnode
*
vnodeAcquire
(
int32_t
vgId
);
SVnode
*
vnodeAcquireNotClose
(
int32_t
vgId
);
void
vnodeRelease
(
SVnode
*
pVnode
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_VNODE_MAIN_H_*/
source/server/vnode/src/vnodeInt.c
浏览文件 @
05613886
此差异已折叠。
点击以展开。
source/server/vnode/src/vnodeMain.c
已删除
100644 → 0
浏览文件 @
cf0ad02d
此差异已折叠。
点击以展开。
source/server/vnode/src/vnodeMgmt.c
浏览文件 @
05613886
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "vnodeMain.h"
#include "vnodeMgmt.h"
#include "vnodeMgmt.h"
#include "vnodeMgmtMsg.h"
#include "vnodeMgmtMsg.h"
...
...
source/server/vnode/src/vnodeMgmtMsg.c
浏览文件 @
05613886
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "vnodeMain.h"
#include "vnodeMgmtMsg.h"
#include "vnodeMgmtMsg.h"
static
SCreateVnodeMsg
*
vnodeParseVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
static
SCreateVnodeMsg
*
vnodeParseVnodeMsg
(
SRpcMsg
*
rpcMsg
)
{
...
...
source/server/vnode/src/vnodeRead.c
浏览文件 @
05613886
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "taosmsg.h"
#include "taosmsg.h"
#include "tglobal.h"
#include "tglobal.h"
// #include "query.h"
// #include "query.h"
#include "vnodeMain.h"
#include "vnodeRead.h"
#include "vnodeRead.h"
#include "vnodeReadMsg.h"
#include "vnodeReadMsg.h"
#include "vnodeStatus.h"
#include "vnodeStatus.h"
...
@@ -81,9 +81,9 @@ static int32_t vnodeWriteToRQueue(SVnode *pVnode, void *pCont, int32_t contLen,
...
@@ -81,9 +81,9 @@ static int32_t vnodeWriteToRQueue(SVnode *pVnode, void *pCont, int32_t contLen,
atomic_add_fetch_32
(
&
pVnode
->
queuedRMsg
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
queuedRMsg
,
1
);
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pRead
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
if
(
pRead
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
pRead
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
return
taosWriteQitem
(
pVnode
->
fqueue
,
qtype
,
pRead
);
return
taosWriteQitem
(
pVnode
->
pFetchQ
,
qtype
,
pRead
);
}
else
{
}
else
{
return
taosWriteQitem
(
pVnode
->
qqueue
,
qtype
,
pRead
);
return
taosWriteQitem
(
pVnode
->
pQueryQ
,
qtype
,
pRead
);
}
}
}
}
...
...
source/server/vnode/src/vnodeReadMsg.c
浏览文件 @
05613886
...
@@ -158,7 +158,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SReadMsg *pRead) {
...
@@ -158,7 +158,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SReadMsg *pRead) {
}
}
}
}
int32_t remain = atomic_add_fetch_32(&pVnode->numOf
Exist
QHandle, 1);
int32_t remain = atomic_add_fetch_32(&pVnode->numOfQHandle, 1);
vTrace("vgId:%d, new qhandle created, total qhandle:%d", pVnode->vgId, remain);
vTrace("vgId:%d, new qhandle created, total qhandle:%d", pVnode->vgId, remain);
} else {
} else {
assert(pCont != NULL);
assert(pCont != NULL);
...
@@ -203,7 +203,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SReadMsg *pRead) {
...
@@ -203,7 +203,7 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SReadMsg *pRead) {
// If the building of result is not required, simply free it. Otherwise, mandatorily free the qhandle
// If the building of result is not required, simply free it. Otherwise, mandatorily free the qhandle
if (freehandle || (!buildRes)) {
if (freehandle || (!buildRes)) {
if (freehandle) {
if (freehandle) {
int32_t remain = atomic_sub_fetch_32(&pVnode->numOf
Exist
QHandle, 1);
int32_t remain = atomic_sub_fetch_32(&pVnode->numOfQHandle, 1);
vTrace("vgId:%d, QInfo:%p, start to free qhandle, remain qhandle:%d", pVnode->vgId, *qhandle, remain);
vTrace("vgId:%d, QInfo:%p, start to free qhandle, remain qhandle:%d", pVnode->vgId, *qhandle, remain);
}
}
...
@@ -283,7 +283,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
...
@@ -283,7 +283,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
// kill current query and free corresponding resources.
// kill current query and free corresponding resources.
if (pRetrieve->free == 1) {
if (pRetrieve->free == 1) {
int32_t remain = atomic_sub_fetch_32(&pVnode->numOf
Exist
QHandle, 1);
int32_t remain = atomic_sub_fetch_32(&pVnode->numOfQHandle, 1);
vWarn("vgId:%d, QInfo:%" PRIx64 "-%p, retrieve msg received to kill query and free qhandle, remain qhandle:%d",
vWarn("vgId:%d, QInfo:%" PRIx64 "-%p, retrieve msg received to kill query and free qhandle, remain qhandle:%d",
pVnode->vgId, pRetrieve->qId, *handle, remain);
pVnode->vgId, pRetrieve->qId, *handle, remain);
...
@@ -297,7 +297,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
...
@@ -297,7 +297,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
// register the qhandle to connect to quit query immediate if connection is broken
// register the qhandle to connect to quit query immediate if connection is broken
if (vnodeNotifyCurrentQhandle(pRead->rpcHandle, pRetrieve->qId, *handle, pVnode->vgId) != TSDB_CODE_SUCCESS) {
if (vnodeNotifyCurrentQhandle(pRead->rpcHandle, pRetrieve->qId, *handle, pVnode->vgId) != TSDB_CODE_SUCCESS) {
int32_t remain = atomic_sub_fetch_32(&pVnode->numOf
Exist
QHandle, 1);
int32_t remain = atomic_sub_fetch_32(&pVnode->numOfQHandle, 1);
vError("vgId:%d, QInfo:%" PRIu64 "-%p, retrieve discarded since link is broken, conn:%p, remain qhandle:%d",
vError("vgId:%d, QInfo:%" PRIu64 "-%p, retrieve discarded since link is broken, conn:%p, remain qhandle:%d",
pVnode->vgId, pRetrieve->qhandle, *handle, pRead->rpcHandle, remain);
pVnode->vgId, pRetrieve->qhandle, *handle, pRead->rpcHandle, remain);
...
@@ -334,7 +334,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
...
@@ -334,7 +334,7 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SReadMsg *pRead) {
// If qhandle is not added into vread queue, the query should be completed already or paused with error.
// If qhandle is not added into vread queue, the query should be completed already or paused with error.
// Here free qhandle immediately
// Here free qhandle immediately
if (freeHandle) {
if (freeHandle) {
int32_t remain = atomic_sub_fetch_32(&pVnode->numOf
Exist
QHandle, 1);
int32_t remain = atomic_sub_fetch_32(&pVnode->numOfQHandle, 1);
vTrace("vgId:%d, QInfo:%p, start to free qhandle, remain qhandle:%d", pVnode->vgId, *handle, remain);
vTrace("vgId:%d, QInfo:%p, start to free qhandle, remain qhandle:%d", pVnode->vgId, *handle, remain);
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);
}
}
...
...
source/server/vnode/src/vnodeVersion.c
浏览文件 @
05613886
...
@@ -58,10 +58,12 @@ int32_t vnodeReadVersion(SVnode *pVnode) {
...
@@ -58,10 +58,12 @@ int32_t vnodeReadVersion(SVnode *pVnode) {
vError
(
"vgId:%d, failed to read %s, version not found"
,
pVnode
->
vgId
,
file
);
vError
(
"vgId:%d, failed to read %s, version not found"
,
pVnode
->
vgId
,
file
);
goto
PARSE_VER_ERROR
;
goto
PARSE_VER_ERROR
;
}
}
#if 0
pVnode->version = (uint64_t)ver->valueint;
pVnode->version = (uint64_t)ver->valueint;
terrno = TSDB_CODE_SUCCESS;
terrno = TSDB_CODE_SUCCESS;
vInfo("vgId:%d, read %s successfully, fver:%" PRIu64, pVnode->vgId, file, pVnode->version);
vInfo("vgId:%d, read %s successfully, fver:%" PRIu64, pVnode->vgId, file, pVnode->version);
#endif
PARSE_VER_ERROR:
PARSE_VER_ERROR:
if
(
content
!=
NULL
)
free
(
content
);
if
(
content
!=
NULL
)
free
(
content
);
...
@@ -85,16 +87,17 @@ int32_t vnodeSaveVersion(SVnode *pVnode) {
...
@@ -85,16 +87,17 @@ int32_t vnodeSaveVersion(SVnode *pVnode) {
int32_t
maxLen
=
100
;
int32_t
maxLen
=
100
;
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
#if 0
len += snprintf(content + len, maxLen - len, "{\n");
len += snprintf(content + len, maxLen - len, "{\n");
len += snprintf(content + len, maxLen - len, " \"version\": %" PRIu64 "\n", pVnode->fversion);
len += snprintf(content + len, maxLen - len, " \"version\": %" PRIu64 "\n", pVnode->fversion);
len += snprintf(content + len, maxLen - len, "}\n");
len += snprintf(content + len, maxLen - len, "}\n");
#endif
fwrite
(
content
,
1
,
len
,
fp
);
fwrite
(
content
,
1
,
len
,
fp
);
taosFsyncFile
(
fileno
(
fp
));
taosFsyncFile
(
fileno
(
fp
));
fclose
(
fp
);
fclose
(
fp
);
free
(
content
);
free
(
content
);
terrno
=
0
;
terrno
=
0
;
vInfo
(
"vgId:%d, successed to write %s, fver:%"
PRIu64
,
pVnode
->
vgId
,
file
,
pVnode
->
fversion
);
//
vInfo("vgId:%d, successed to write %s, fver:%" PRIu64, pVnode->vgId, file, pVnode->fversion);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
\ No newline at end of file
source/server/vnode/src/vnodeWorker.c
浏览文件 @
05613886
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "os.h"
#include "vnodeMain.h"
#include "vnodeWorker.h"
#include "vnodeWorker.h"
enum
{
CLEANUP_TASK
=
0
,
DESTROY_TASK
=
1
,
BACKUP_TASK
=
2
};
enum
{
CLEANUP_TASK
=
0
,
DESTROY_TASK
=
1
,
BACKUP_TASK
=
2
};
...
...
source/server/vnode/src/vnodeWrite.c
浏览文件 @
05613886
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "tqueue.h"
#include "tqueue.h"
#include "tworker.h"
#include "tworker.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "vnodeMain.h"
#include "vnodeStatus.h"
#include "vnodeStatus.h"
#include "vnodeWrite.h"
#include "vnodeWrite.h"
#include "vnodeWriteMsg.h"
#include "vnodeWriteMsg.h"
...
@@ -96,7 +96,7 @@ static int32_t vnodeWriteToWQueue(SVnode *pVnode, SWalHead *pHead, int32_t qtype
...
@@ -96,7 +96,7 @@ static int32_t vnodeWriteToWQueue(SVnode *pVnode, SWalHead *pHead, int32_t qtype
atomic_add_fetch_32
(
&
tsVwrite
.
queuedMsgs
,
1
);
atomic_add_fetch_32
(
&
tsVwrite
.
queuedMsgs
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
queuedWMsg
,
1
);
atomic_add_fetch_32
(
&
pVnode
->
queuedWMsg
,
1
);
taosWriteQitem
(
pVnode
->
wqueue
,
pWrite
->
qtype
,
pWrite
);
taosWriteQitem
(
pVnode
->
pWriteQ
,
pWrite
->
qtype
,
pWrite
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -153,10 +153,10 @@ static bool vnodeProcessWriteStart(SVnode *pVnode, SVnWriteMsg *pWrite, int32_t
...
@@ -153,10 +153,10 @@ static bool vnodeProcessWriteStart(SVnode *pVnode, SVnWriteMsg *pWrite, int32_t
#if 0
#if 0
pWrite->code = walWrite(pVnode->wal, pHead);
pWrite->code = walWrite(pVnode->wal, pHead);
if (pWrite->code < 0) return false;
if (pWrite->code < 0) return false;
#endif
pVnode
->
version
=
pHead
->
version
;
pVnode->version = pHead->version;
#endif
// write data locally
// write data locally
switch
(
msgType
)
{
switch
(
msgType
)
{
case
TSDB_MSG_TYPE_SUBMIT
:
case
TSDB_MSG_TYPE_SUBMIT
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录