Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e818e4aa
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
e818e4aa
编写于
1月 06, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more integration
上级
ae426947
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
133 addition
and
128 deletion
+133
-128
source/dnode/vnode/tsdb2/src/tsdbFS.c
source/dnode/vnode/tsdb2/src/tsdbFS.c
+11
-11
source/dnode/vnode/tsdb2/src/tsdbMeta.c
source/dnode/vnode/tsdb2/src/tsdbMeta.c
+120
-115
source/dnode/vnode/tsdb2/src/tsdbRead.c
source/dnode/vnode/tsdb2/src/tsdbRead.c
+2
-2
未找到文件。
source/dnode/vnode/tsdb2/src/tsdbFS.c
浏览文件 @
e818e4aa
...
@@ -442,7 +442,7 @@ static int tsdbSaveFSStatus(SFSStatus *pStatus, int vid) {
...
@@ -442,7 +442,7 @@ static int tsdbSaveFSStatus(SFSStatus *pStatus, int vid) {
taosCalcChecksumAppend
(
0
,
(
uint8_t
*
)
hbuf
,
TSDB_FILE_HEAD_SIZE
);
taosCalcChecksumAppend
(
0
,
(
uint8_t
*
)
hbuf
,
TSDB_FILE_HEAD_SIZE
);
if
(
taosWrite
(
fd
,
hbuf
,
TSDB_FILE_HEAD_SIZE
)
<
TSDB_FILE_HEAD_SIZE
)
{
if
(
taosWrite
File
(
fd
,
hbuf
,
TSDB_FILE_HEAD_SIZE
)
<
TSDB_FILE_HEAD_SIZE
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
close
(
fd
);
close
(
fd
);
remove
(
tfname
);
remove
(
tfname
);
...
@@ -461,7 +461,7 @@ static int tsdbSaveFSStatus(SFSStatus *pStatus, int vid) {
...
@@ -461,7 +461,7 @@ static int tsdbSaveFSStatus(SFSStatus *pStatus, int vid) {
tsdbEncodeFSStatus
(
&
ptr
,
pStatus
);
tsdbEncodeFSStatus
(
&
ptr
,
pStatus
);
taosCalcChecksumAppend
(
0
,
(
uint8_t
*
)
pBuf
,
fsheader
.
len
);
taosCalcChecksumAppend
(
0
,
(
uint8_t
*
)
pBuf
,
fsheader
.
len
);
if
(
taosWrite
(
fd
,
pBuf
,
fsheader
.
len
)
<
fsheader
.
len
)
{
if
(
taosWrite
File
(
fd
,
pBuf
,
fsheader
.
len
)
<
fsheader
.
len
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
close
(
fd
);
close
(
fd
);
(
void
)
remove
(
tfname
);
(
void
)
remove
(
tfname
);
...
@@ -677,7 +677,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
...
@@ -677,7 +677,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
goto
_err
;
goto
_err
;
}
}
int
nread
=
(
int
)
taosRead
(
fd
,
buffer
,
TSDB_FILE_HEAD_SIZE
);
int
nread
=
(
int
)
taosRead
File
(
fd
,
buffer
,
TSDB_FILE_HEAD_SIZE
);
if
(
nread
<
0
)
{
if
(
nread
<
0
)
{
tsdbError
(
"vgId:%d failed to read %d bytes from file %s since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILENAME_LEN
,
current
,
tsdbError
(
"vgId:%d failed to read %d bytes from file %s since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILENAME_LEN
,
current
,
strerror
(
errno
));
strerror
(
errno
));
...
@@ -711,7 +711,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
...
@@ -711,7 +711,7 @@ static int tsdbOpenFSFromCurrent(STsdbRepo *pRepo) {
goto
_err
;
goto
_err
;
}
}
nread
=
(
int
)
taosRead
(
fd
,
buffer
,
fsheader
.
len
);
nread
=
(
int
)
taosRead
File
(
fd
,
buffer
,
fsheader
.
len
);
if
(
nread
<
0
)
{
if
(
nread
<
0
)
{
tsdbError
(
"vgId:%d failed to read file %s since %s"
,
REPO_ID
(
pRepo
),
current
,
strerror
(
errno
));
tsdbError
(
"vgId:%d failed to read file %s since %s"
,
REPO_ID
(
pRepo
),
current
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
@@ -1207,7 +1207,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1207,7 +1207,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
}
}
if
((
fArraySize
=
taosArrayGetSize
(
fArray
))
<=
0
)
{
if
((
fArraySize
=
taosArrayGetSize
(
fArray
))
<=
0
)
{
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
tsdbInfo
(
"vgId:%d size of DFileSet from %s is %"
PRIu32
,
REPO_ID
(
pRepo
),
dataDir
,
(
uint32_t
)
fArraySize
);
tsdbInfo
(
"vgId:%d size of DFileSet from %s is %"
PRIu32
,
REPO_ID
(
pRepo
),
dataDir
,
(
uint32_t
)
fArraySize
);
return
0
;
return
0
;
}
}
...
@@ -1258,7 +1258,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1258,7 +1258,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// return error in case of removing uncomplete DFileSets
// return error in case of removing uncomplete DFileSets
// terrno = TSDB_CODE_TDB_INCOMPLETE_DFILESET;
// terrno = TSDB_CODE_TDB_INCOMPLETE_DFILESET;
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -1271,7 +1271,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1271,7 +1271,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// return error in case of removing uncomplete DFileSets
// return error in case of removing uncomplete DFileSets
// terrno = TSDB_CODE_TDB_INCOMPLETE_DFILESET;
// terrno = TSDB_CODE_TDB_INCOMPLETE_DFILESET;
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
-
1
;
return
-
1
;
#if 0
#if 0
// next FSet
// next FSet
...
@@ -1293,14 +1293,14 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1293,14 +1293,14 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
if
(
tsdbOpenDFile
(
pDFile1
,
O_RDONLY
)
<
0
)
{
if
(
tsdbOpenDFile
(
pDFile1
,
O_RDONLY
)
<
0
)
{
tsdbError
(
"vgId:%d failed to open DFile %s since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tsdbError
(
"vgId:%d failed to open DFile %s since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tstrerror
(
terrno
));
tstrerror
(
terrno
));
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
-
1
;
return
-
1
;
}
}
if
(
tsdbLoadDFileHeader
(
pDFile1
,
&
(
pDFile1
->
info
))
<
0
)
{
if
(
tsdbLoadDFileHeader
(
pDFile1
,
&
(
pDFile1
->
info
))
<
0
)
{
tsdbError
(
"vgId:%d failed to load DFile %s header since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tsdbError
(
"vgId:%d failed to load DFile %s header since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tstrerror
(
terrno
));
tstrerror
(
terrno
));
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1310,7 +1310,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1310,7 +1310,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// Get real file size
// Get real file size
if
(
fstat
(
pDFile1
->
fd
,
&
tfstat
)
<
0
)
{
if
(
fstat
(
pDFile1
->
fd
,
&
tfstat
)
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1346,7 +1346,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1346,7 +1346,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
}
}
// Resource release
// Resource release
taosArrayDestroy
(
&
fArray
);
taosArrayDestroy
(
fArray
);
return
0
;
return
0
;
}
}
...
...
source/dnode/vnode/tsdb2/src/tsdbMeta.c
浏览文件 @
e818e4aa
此差异已折叠。
点击以展开。
source/dnode/vnode/tsdb2/src/tsdbRead.c
浏览文件 @
e818e4aa
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
#include "taosdef.h"
#include "taosdef.h"
#include "tlosertree.h"
#include "tlosertree.h"
#include "tsdbint.h"
#include "tsdbint.h"
#include "texpr.h"
//
#include "texpr.h"
#include "qFilter.h"
//
#include "qFilter.h"
#include "cJSON.h"
#include "cJSON.h"
#define EXTRA_BYTES 2
#define EXTRA_BYTES 2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录