Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cae57255
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看板
提交
cae57255
编写于
6月 23, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more work
上级
c58b43ba
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
6 deletion
+15
-6
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+4
-4
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+2
-0
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+7
-2
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+2
-0
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
cae57255
...
...
@@ -33,10 +33,10 @@
#include "tlist.h"
#include "tlockfree.h"
#include "tlosertree.h"
#include "tlrucache.h"
#include "tmallocator.h"
#include "tmsgcb.h"
#include "tskiplist.h"
#include "tlrucache.h"
#include "tstream.h"
#include "ttime.h"
#include "ttimer.h"
...
...
@@ -88,7 +88,7 @@ int metaAlterSTable(SMeta* pMeta, int64_t version, SVCreateStbReq* p
int
metaDropSTable
(
SMeta
*
pMeta
,
int64_t
verison
,
SVDropStbReq
*
pReq
);
int
metaCreateTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateTbReq
*
pReq
);
int
metaDropTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVDropTbReq
*
pReq
,
SArray
*
tbUids
);
int
metaTtlDropTable
(
SMeta
*
pMeta
,
int64_t
ttl
,
SArray
*
tbUids
);
int
metaTtlDropTable
(
SMeta
*
pMeta
,
int64_t
ttl
,
SArray
*
tbUids
);
int
metaAlterTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVAlterTbReq
*
pReq
,
STableMetaRsp
*
pMetaRsp
);
SSchemaWrapper
*
metaGetTableSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
,
bool
isinline
);
STSchema
*
metaGetTbTSchema
(
SMeta
*
pMeta
,
tb_uid_t
uid
,
int32_t
sver
);
...
...
@@ -107,7 +107,7 @@ int32_t metaSnapshotReaderClose(SMetaSnapshotReader* pReader);
int32_t
metaSnapshotRead
(
SMetaSnapshotReader
*
pReader
,
void
**
ppData
,
uint32_t
*
nData
);
void
*
metaGetIdx
(
SMeta
*
pMeta
);
void
*
metaGetIvtIdx
(
SMeta
*
pMeta
);
int
metaTtlSmaller
(
SMeta
*
pMeta
,
uint64_t
time
,
SArray
*
uidList
);
int
metaTtlSmaller
(
SMeta
*
pMeta
,
uint64_t
time
,
SArray
*
uidList
);
int32_t
metaCreateTSma
(
SMeta
*
pMeta
,
int64_t
version
,
SSmaCfg
*
pCfg
);
int32_t
metaDropTSma
(
SMeta
*
pMeta
,
int64_t
indexUid
);
...
...
@@ -183,9 +183,9 @@ typedef struct {
// SVState
struct
SVState
{
// int64_t processed;
int64_t
committed
;
int64_t
applied
;
int64_t
commitID
;
};
struct
SVnodeInfo
{
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
cae57255
...
...
@@ -18,6 +18,7 @@
typedef
struct
{
STsdb
*
pTsdb
;
/* commit data */
int64_t
commitID
;
int32_t
minutes
;
int8_t
precision
;
int32_t
minRow
;
...
...
@@ -837,6 +838,7 @@ static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter) {
// unlock();
pCommitter
->
pTsdb
=
pTsdb
;
pCommitter
->
commitID
=
pTsdb
->
pVnode
->
state
.
commitID
;
pCommitter
->
minutes
=
pTsdb
->
keepCfg
.
days
;
pCommitter
->
precision
=
pTsdb
->
keepCfg
.
precision
;
pCommitter
->
minRow
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
minRows
;
...
...
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
cae57255
...
...
@@ -40,6 +40,7 @@ int vnodeBegin(SVnode *pVnode) {
/* pthread_mutex_unlock(); */
pVnode
->
state
.
commitID
++
;
// begin meta
if
(
metaBegin
(
pVnode
->
pMeta
)
<
0
)
{
vError
(
"vgId:%d, failed to begin meta since %s"
,
TD_VID
(
pVnode
),
tstrerror
(
terrno
));
...
...
@@ -210,7 +211,8 @@ int vnodeCommit(SVnode *pVnode) {
SVnodeInfo
info
=
{
0
};
char
dir
[
TSDB_FILENAME_LEN
];
vInfo
(
"vgId:%d, start to commit, version: %"
PRId64
,
TD_VID
(
pVnode
),
pVnode
->
state
.
applied
);
vInfo
(
"vgId:%d, start to commit, commit ID:%"
PRId64
" version:%"
PRId64
,
TD_VID
(
pVnode
),
pVnode
->
state
.
commitID
,
pVnode
->
state
.
applied
);
pVnode
->
onCommit
=
pVnode
->
inUse
;
pVnode
->
inUse
=
NULL
;
...
...
@@ -278,7 +280,7 @@ static int vnodeCommitImpl(void *arg) {
// metaCommit(pVnode->pMeta);
tqCommit
(
pVnode
->
pTq
);
tsdbCommit
(
pVnode
->
pTsdb
);
// tsdbCommit(pVnode->pTsdb,
);
// vnodeBufPoolRecycle(pVnode);
tsem_post
(
&
(
pVnode
->
canCommit
));
...
...
@@ -302,6 +304,7 @@ static int vnodeEncodeState(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"commit version"
,
pState
->
committed
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"applied version"
,
pState
->
applied
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"commit ID"
,
pState
->
commitID
)
<
0
)
return
-
1
;
return
0
;
}
...
...
@@ -314,6 +317,8 @@ static int vnodeDecodeState(const SJson *pJson, void *pObj) {
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"applied version"
,
pState
->
applied
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"commit ID"
,
pState
->
commitID
,
code
);
if
(
code
<
0
)
return
-
1
;
return
0
;
}
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
cae57255
...
...
@@ -37,6 +37,7 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
info
.
config
=
*
pCfg
;
info
.
state
.
committed
=
-
1
;
info
.
state
.
applied
=
-
1
;
info
.
state
.
commitID
=
0
;
if
(
vnodeSaveInfo
(
dir
,
&
info
)
<
0
||
vnodeCommitInfo
(
dir
,
&
info
)
<
0
)
{
vError
(
"vgId:%d, failed to save vnode config since %s"
,
pCfg
->
vgId
,
tstrerror
(
terrno
));
...
...
@@ -79,6 +80,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
pVnode
->
config
=
info
.
config
;
pVnode
->
state
.
committed
=
info
.
state
.
committed
;
pVnode
->
state
.
applied
=
info
.
state
.
committed
;
pVnode
->
state
.
commitID
=
info
.
state
.
commitID
;
pVnode
->
pTfs
=
pTfs
;
pVnode
->
msgCb
=
msgCb
;
pVnode
->
syncCount
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录