Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
40a591bd
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看板
提交
40a591bd
编写于
9月 24, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync compatibility for upgrading
上级
466c05a4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
13 deletion
+17
-13
src/tsdb/inc/tsdbFile.h
src/tsdb/inc/tsdbFile.h
+1
-1
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+2
-2
src/tsdb/src/tsdbCompact.c
src/tsdb/src/tsdbCompact.c
+1
-1
src/tsdb/src/tsdbFS.c
src/tsdb/src/tsdbFS.c
+2
-1
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+4
-4
src/tsdb/src/tsdbSync.c
src/tsdb/src/tsdbSync.c
+7
-4
未找到文件。
src/tsdb/inc/tsdbFile.h
浏览文件 @
40a591bd
...
...
@@ -324,7 +324,7 @@ typedef struct {
} \
} while (0);
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
);
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
,
uint8_t
nFiles
);
void
tsdbInitDFileSetEx
(
SDFileSet
*
pSet
,
SDFileSet
*
pOSet
);
int
tsdbEncodeDFileSet
(
void
**
buf
,
SDFileSet
*
pSet
);
void
*
tsdbDecodeDFileSet
(
void
*
buf
,
SDFileSet
*
pSet
,
uint32_t
sfver
);
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
40a591bd
...
...
@@ -139,7 +139,7 @@ int tsdbApplyRtnOnFSet(STsdbRepo *pRepo, SDFileSet *pSet, SRtn *pRtn) {
if
(
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
// Need to move the FSET to higher level
tsdbInitDFileSet
(
&
nSet
,
did
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
FS_TXN_VERSION
(
pfs
));
tsdbInitDFileSet
(
&
nSet
,
did
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
FS_TXN_VERSION
(
pfs
)
,
TSDB_FILE_MAX
);
if
(
tsdbCopyDFileSet
(
pSet
,
&
nSet
)
<
0
)
{
tsdbError
(
"vgId:%d failed to copy FSET %d from level %d to level %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
...
...
@@ -1598,7 +1598,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
// Set and open commit FSET
if
(
pSet
==
NULL
||
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
// Create a new FSET to write data
tsdbInitDFileSet
(
pWSet
,
did
,
REPO_ID
(
pRepo
),
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
tsdbInitDFileSet
(
pWSet
,
did
,
REPO_ID
(
pRepo
),
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
))
,
TSDB_FILE_MAX
);
if
(
tsdbCreateDFileSet
(
pWSet
,
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to create FSET %d at level %d disk id %d since %s"
,
REPO_ID
(
pRepo
),
...
...
src/tsdb/src/tsdbCompact.c
浏览文件 @
40a591bd
...
...
@@ -197,7 +197,7 @@ static int tsdbCompactMeta(STsdbRepo *pRepo) {
}
tsdbInitDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
did
,
REPO_ID
(
pRepo
),
TSDB_FSET_FID
(
pSet
),
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
FS_TXN_VERSION
(
REPO_FS
(
pRepo
))
,
TSDB_FILE_MAX
);
if
(
tsdbCreateDFileSet
(
TSDB_COMPACT_WSET
(
pComph
),
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to compact FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCompactFSetEnd
(
pComph
);
...
...
src/tsdb/src/tsdbFS.c
浏览文件 @
40a591bd
...
...
@@ -100,7 +100,8 @@ static int tsdbDecodeDFileSetArray(void **originBuf, void *buf, SArray *pArray,
buf
=
taosDecodeFixedU64
(
buf
,
&
nset
);
if
(
pSFSHeader
->
version
==
TSDB_FS_VER_0
)
{
uint64_t
extendedSize
=
pSFSHeader
->
len
+
nset
*
TSDB_FILE_MAX
*
sizeof
(
TSDB_FVER_TYPE
);
// record fver in new version of 'current' file
uint64_t
extendedSize
=
pSFSHeader
->
len
+
nset
*
TSDB_FILE_MAX
*
sizeof
(
TSDB_FVER_TYPE
);
if
(
taosTSizeof
(
*
originBuf
)
<
extendedSize
)
{
size_t
ptrDistance
=
POINTER_DISTANCE
(
buf
,
*
originBuf
);
if
(
tsdbMakeRoom
(
originBuf
,
(
size_t
)
extendedSize
)
<
0
)
{
...
...
src/tsdb/src/tsdbFile.c
浏览文件 @
40a591bd
...
...
@@ -563,12 +563,12 @@ static int tsdbRollBackDFile(SDFile *pDFile) {
}
// ============== Operations on SDFileSet
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
)
{
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
,
uint8_t
nFiles
)
{
pSet
->
fid
=
fid
;
pSet
->
state
=
0
;
pSet
->
nFiles
=
TSDB_FILE_MAX
;
pSet
->
nFiles
=
nFiles
;
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
nFiles
;
ftype
++
)
{
SDFile
*
pDFile
=
TSDB_DFILE_IN_SET
(
pSet
,
ftype
);
tsdbInitDFile
(
pDFile
,
did
,
vid
,
fid
,
ver
,
ftype
);
}
...
...
@@ -651,7 +651,7 @@ int tsdbApplyDFileSetChange(SDFileSet *from, SDFileSet *to) {
}
int
tsdbCreateDFileSet
(
SDFileSet
*
pSet
,
bool
updateHeader
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
pSet
->
nFiles
;
ftype
++
)
{
if
(
tsdbCreateDFile
(
TSDB_DFILE_IN_SET
(
pSet
,
ftype
),
updateHeader
,
ftype
)
<
0
)
{
tsdbCloseDFileSet
(
pSet
);
tsdbRemoveDFileSet
(
pSet
);
...
...
src/tsdb/src/tsdbSync.c
浏览文件 @
40a591bd
...
...
@@ -466,7 +466,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
return
-
1
;
}
tsdbInitDFileSet
(
&
fset
,
did
,
REPO_ID
(
pRepo
),
pSynch
->
pdf
->
fid
,
FS_TXN_VERSION
(
pfs
));
tsdbInitDFileSet
(
&
fset
,
did
,
REPO_ID
(
pRepo
),
pSynch
->
pdf
->
fid
,
FS_TXN_VERSION
(
pfs
)
,
pSynch
->
pdf
->
nFiles
);
// Create new FSET
if
(
tsdbCreateDFileSet
(
&
fset
,
false
)
<
0
)
{
...
...
@@ -474,7 +474,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
return
-
1
;
}
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
pSynch
->
pdf
->
nFiles
;
ftype
++
)
{
SDFile
*
pDFile
=
TSDB_DFILE_IN_SET
(
&
fset
,
ftype
);
// local file
SDFile
*
pRDFile
=
TSDB_DFILE_IN_SET
(
pSynch
->
pdf
,
ftype
);
// remote file
...
...
@@ -550,7 +550,10 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
}
static
bool
tsdbIsTowFSetSame
(
SDFileSet
*
pSet1
,
SDFileSet
*
pSet2
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
if
(
pSet1
->
nFiles
!=
pSet2
->
nFiles
)
{
return
false
;
}
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
pSet1
->
nFiles
;
ftype
++
)
{
SDFile
*
pDFile1
=
TSDB_DFILE_IN_SET
(
pSet1
,
ftype
);
SDFile
*
pDFile2
=
TSDB_DFILE_IN_SET
(
pSet2
,
ftype
);
...
...
@@ -592,7 +595,7 @@ static int32_t tsdbSyncSendDFileSet(SSyncH *pSynch, SDFileSet *pSet) {
if
(
toSend
)
{
tsdbInfo
(
"vgId:%d, fileset:%d will be sent"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
pSet
->
nFiles
;
ftype
++
)
{
SDFile
df
=
*
TSDB_DFILE_IN_SET
(
pSet
,
ftype
);
if
(
tsdbOpenDFile
(
&
df
,
O_RDONLY
)
<
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录