Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
4f0ed079
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4f0ed079
编写于
11月 08, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1919 change version type to uint64
上级
047955ab
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
11 addition
and
8 deletion
+11
-8
src/inc/twal.h
src/inc/twal.h
+1
-1
src/vnode/inc/vnodeInt.h
src/vnode/inc/vnodeInt.h
+2
-2
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+3
-0
src/vnode/src/vnodeVersion.c
src/vnode/src/vnodeVersion.c
+4
-4
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+1
-1
未找到文件。
src/inc/twal.h
浏览文件 @
4f0ed079
...
...
@@ -63,7 +63,7 @@ int32_t walWrite(twalh, SWalHead *);
void
walFsync
(
twalh
,
bool
forceFsync
);
int32_t
walRestore
(
twalh
,
void
*
pVnode
,
FWalWrite
writeFp
);
int32_t
walGetWalFile
(
twalh
,
char
*
fileName
,
int64_t
*
fileId
);
int64_t
walGetVersion
(
twalh
);
u
int64_t
walGetVersion
(
twalh
);
#ifdef __cplusplus
}
...
...
src/vnode/inc/vnodeInt.h
浏览文件 @
4f0ed079
...
...
@@ -41,8 +41,8 @@ typedef struct {
int8_t
status
;
int8_t
role
;
int8_t
accessState
;
int64_t
version
;
// current version
int64_t
fversion
;
// version on saved data file
uint64_t
version
;
// current version
uint64_t
fversion
;
// version on saved data file
void
*
wqueue
;
void
*
rqueue
;
void
*
wal
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
4f0ed079
...
...
@@ -227,6 +227,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode
->
vgId
=
vnode
;
pVnode
->
status
=
TAOS_VN_STATUS_INIT
;
pVnode
->
fversion
=
0
;
pVnode
->
version
=
0
;
pVnode
->
tsdbCfg
.
tsdbId
=
pVnode
->
vgId
;
pVnode
->
rootDir
=
strdup
(
rootDir
);
...
...
@@ -288,6 +289,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
vnodeCleanUp
(
pVnode
);
return
terrno
;
}
else
{
pVnode
->
fversion
=
0
;
pVnode
->
version
=
0
;
}
}
...
...
@@ -302,6 +304,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
walRestore
(
pVnode
->
wal
,
pVnode
,
vnodeProcessWrite
);
if
(
pVnode
->
version
==
0
)
{
pVnode
->
fversion
=
0
;
pVnode
->
version
=
walGetVersion
(
pVnode
->
wal
);
}
...
...
src/vnode/src/vnodeVersion.c
浏览文件 @
4f0ed079
...
...
@@ -61,10 +61,10 @@ int32_t vnodeReadVersion(SVnodeObj *pVnode) {
vError
(
"vgId:%d, failed to read %s, version not found"
,
pVnode
->
vgId
,
file
);
goto
PARSE_VER_ERROR
;
}
pVnode
->
version
=
ver
->
valueint
;
pVnode
->
version
=
(
uint64_t
)
ver
->
valueint
;
terrno
=
TSDB_CODE_SUCCESS
;
vInfo
(
"vgId:%d, read %s successfully, version:%"
PRI
d
64
,
pVnode
->
vgId
,
file
,
pVnode
->
version
);
vInfo
(
"vgId:%d, read %s successfully, version:%"
PRI
u
64
,
pVnode
->
vgId
,
file
,
pVnode
->
version
);
PARSE_VER_ERROR:
if
(
content
!=
NULL
)
free
(
content
);
...
...
@@ -89,7 +89,7 @@ int32_t vnodeSaveVersion(SVnodeObj *pVnode) {
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
version
\"
: %"
PRI
d
64
"
\n
"
,
pVnode
->
fversion
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
version
\"
: %"
PRI
u
64
"
\n
"
,
pVnode
->
fversion
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"}
\n
"
);
fwrite
(
content
,
1
,
len
,
fp
);
...
...
@@ -98,6 +98,6 @@ int32_t vnodeSaveVersion(SVnodeObj *pVnode) {
free
(
content
);
terrno
=
0
;
vInfo
(
"vgId:%d, successed to write %s, version:%"
PRI
d
64
,
pVnode
->
vgId
,
file
,
pVnode
->
fversion
);
vInfo
(
"vgId:%d, successed to write %s, version:%"
PRI
u
64
,
pVnode
->
vgId
,
file
,
pVnode
->
fversion
);
return
TSDB_CODE_SUCCESS
;
}
\ No newline at end of file
src/wal/src/walWrite.c
浏览文件 @
4f0ed079
...
...
@@ -310,7 +310,7 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
return
code
;
}
int64_t
walGetVersion
(
twalh
param
)
{
u
int64_t
walGetVersion
(
twalh
param
)
{
SWal
*
pWal
=
param
;
if
(
pWal
==
0
)
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录