Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cc556371
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看板
提交
cc556371
编写于
1月 18, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
ed9709c3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
26 deletion
+28
-26
source/dnode/vnode/inc/tsdb.h
source/dnode/vnode/inc/tsdb.h
+1
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/inc/tsdbFile.h
source/dnode/vnode/src/inc/tsdbFile.h
+5
-5
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+4
-4
source/dnode/vnode/src/tsdb/tsdbFS.c
source/dnode/vnode/src/tsdb/tsdbFS.c
+7
-7
source/dnode/vnode/src/tsdb/tsdbFile.c
source/dnode/vnode/src/tsdb/tsdbFile.c
+9
-9
source/libs/tfs/src/tfs.c
source/libs/tfs/src/tfs.c
+1
-1
未找到文件。
source/dnode/vnode/inc/tsdb.h
浏览文件 @
cc556371
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "mallocator.h"
#include "mallocator.h"
#include "meta.h"
#include "meta.h"
#include "common.h"
#include "common.h"
#include "tfs.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
cc556371
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "meta.h"
#include "meta.h"
#include "tarray.h"
#include "tarray.h"
#include "tfs.h"
#include "tq.h"
#include "tq.h"
#include "tsdb.h"
#include "tsdb.h"
#include "wal.h"
#include "wal.h"
...
...
source/dnode/vnode/src/inc/tsdbFile.h
浏览文件 @
cc556371
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define TSDB_FILE_INFO(tf) (&((tf)->info))
#define TSDB_FILE_INFO(tf) (&((tf)->info))
#define TSDB_FILE_F(tf) (&((tf)->f))
#define TSDB_FILE_F(tf) (&((tf)->f))
#define TSDB_FILE_FD(tf) ((tf)->fd)
#define TSDB_FILE_FD(tf) ((tf)->fd)
#define TSDB_FILE_FULL_NAME(tf)
TFILE_NAME(TSDB_FILE_F(tf)
)
#define TSDB_FILE_FULL_NAME(tf)
(TSDB_FILE_F(tf)->aname
)
#define TSDB_FILE_OPENED(tf) (TSDB_FILE_FD(tf) >= 0)
#define TSDB_FILE_OPENED(tf) (TSDB_FILE_FD(tf) >= 0)
#define TSDB_FILE_CLOSED(tf) (!TSDB_FILE_OPENED(tf))
#define TSDB_FILE_CLOSED(tf) (!TSDB_FILE_OPENED(tf))
#define TSDB_FILE_SET_CLOSED(f) (TSDB_FILE_FD(f) = -1)
#define TSDB_FILE_SET_CLOSED(f) (TSDB_FILE_FD(f) = -1)
...
@@ -181,10 +181,10 @@ typedef struct {
...
@@ -181,10 +181,10 @@ typedef struct {
uint8_t
state
;
uint8_t
state
;
}
SDFile
;
}
SDFile
;
void
tsdbInitDFile
(
S
DFile
*
pDFile
,
SDiskID
did
,
int
v
id
,
int
fid
,
uint32_t
ver
,
TSDB_FILE_T
ftype
);
void
tsdbInitDFile
(
S
Tsdb
*
pRepo
,
SDFile
*
pDFile
,
SDiskID
d
id
,
int
fid
,
uint32_t
ver
,
TSDB_FILE_T
ftype
);
void
tsdbInitDFileEx
(
SDFile
*
pDFile
,
SDFile
*
pODFile
);
void
tsdbInitDFileEx
(
SDFile
*
pDFile
,
SDFile
*
pODFile
);
int
tsdbEncodeSDFile
(
void
**
buf
,
SDFile
*
pDFile
);
int
tsdbEncodeSDFile
(
void
**
buf
,
SDFile
*
pDFile
);
void
*
tsdbDecodeSDFile
(
void
*
buf
,
SDFile
*
pDFile
);
void
*
tsdbDecodeSDFile
(
STsdb
*
pRepo
,
void
*
buf
,
SDFile
*
pDFile
);
int
tsdbCreateDFile
(
SDFile
*
pDFile
,
bool
updateHeader
);
int
tsdbCreateDFile
(
SDFile
*
pDFile
,
bool
updateHeader
);
int
tsdbUpdateDFileHeader
(
SDFile
*
pDFile
);
int
tsdbUpdateDFileHeader
(
SDFile
*
pDFile
);
int
tsdbLoadDFileHeader
(
SDFile
*
pDFile
,
SDFInfo
*
pInfo
);
int
tsdbLoadDFileHeader
(
SDFile
*
pDFile
,
SDFInfo
*
pInfo
);
...
@@ -311,10 +311,10 @@ typedef struct {
...
@@ -311,10 +311,10 @@ typedef struct {
} \
} \
} while (0);
} while (0);
void
tsdbInitDFileSet
(
S
DFileSet
*
pSet
,
SDiskID
did
,
int
v
id
,
int
fid
,
uint32_t
ver
);
void
tsdbInitDFileSet
(
S
Tsdb
*
pRepo
,
SDFileSet
*
pSet
,
SDiskID
d
id
,
int
fid
,
uint32_t
ver
);
void
tsdbInitDFileSetEx
(
SDFileSet
*
pSet
,
SDFileSet
*
pOSet
);
void
tsdbInitDFileSetEx
(
SDFileSet
*
pSet
,
SDFileSet
*
pOSet
);
int
tsdbEncodeDFileSet
(
void
**
buf
,
SDFileSet
*
pSet
);
int
tsdbEncodeDFileSet
(
void
**
buf
,
SDFileSet
*
pSet
);
void
*
tsdbDecodeDFileSet
(
void
*
buf
,
SDFileSet
*
pSet
);
void
*
tsdbDecodeDFileSet
(
STsdb
*
pRepo
,
void
*
buf
,
SDFileSet
*
pSet
);
int
tsdbEncodeDFileSetEx
(
void
**
buf
,
SDFileSet
*
pSet
);
int
tsdbEncodeDFileSetEx
(
void
**
buf
,
SDFileSet
*
pSet
);
void
*
tsdbDecodeDFileSetEx
(
void
*
buf
,
SDFileSet
*
pSet
);
void
*
tsdbDecodeDFileSetEx
(
void
*
buf
,
SDFileSet
*
pSet
);
int
tsdbApplyDFileSetChange
(
SDFileSet
*
from
,
SDFileSet
*
to
);
int
tsdbApplyDFileSetChange
(
SDFileSet
*
from
,
SDFileSet
*
to
);
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
cc556371
...
@@ -104,7 +104,7 @@ int tsdbApplyRtnOnFSet(STsdb *pRepo, SDFileSet *pSet, SRtn *pRtn) {
...
@@ -104,7 +104,7 @@ int tsdbApplyRtnOnFSet(STsdb *pRepo, SDFileSet *pSet, SRtn *pRtn) {
if
(
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
if
(
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
// Need to move the FSET to higher level
// Need to move the FSET to higher level
tsdbInitDFileSet
(
&
nSet
,
did
,
REPO_ID
(
pRepo
)
,
pSet
->
fid
,
FS_TXN_VERSION
(
pfs
));
tsdbInitDFileSet
(
pRepo
,
&
nSet
,
did
,
pSet
->
fid
,
FS_TXN_VERSION
(
pfs
));
if
(
tsdbCopyDFileSet
(
pSet
,
&
nSet
)
<
0
)
{
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
,
tsdbError
(
"vgId:%d failed to copy FSET %d from level %d to level %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
...
@@ -482,7 +482,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
...
@@ -482,7 +482,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
// Set and open commit FSET
// Set and open commit FSET
if
(
pSet
==
NULL
||
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
if
(
pSet
==
NULL
||
did
.
level
>
TSDB_FSET_LEVEL
(
pSet
))
{
// Create a new FSET to write data
// Create a new FSET to write data
tsdbInitDFileSet
(
p
WSet
,
did
,
REPO_ID
(
pRepo
)
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
tsdbInitDFileSet
(
p
Repo
,
pWSet
,
did
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)));
if
(
tsdbCreateDFileSet
(
pWSet
,
true
)
<
0
)
{
if
(
tsdbCreateDFileSet
(
pWSet
,
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to create FSET %d at level %d disk id %d since %s"
,
REPO_ID
(
pRepo
),
tsdbError
(
"vgId:%d failed to create FSET %d at level %d disk id %d since %s"
,
REPO_ID
(
pRepo
),
...
@@ -507,7 +507,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
...
@@ -507,7 +507,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
// TSDB_FILE_HEAD
// TSDB_FILE_HEAD
SDFile
*
pWHeadf
=
TSDB_COMMIT_HEAD_FILE
(
pCommith
);
SDFile
*
pWHeadf
=
TSDB_COMMIT_HEAD_FILE
(
pCommith
);
tsdbInitDFile
(
p
WHeadf
,
did
,
REPO_ID
(
pRepo
)
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)),
TSDB_FILE_HEAD
);
tsdbInitDFile
(
p
Repo
,
pWHeadf
,
did
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)),
TSDB_FILE_HEAD
);
if
(
tsdbCreateDFile
(
pWHeadf
,
true
)
<
0
)
{
if
(
tsdbCreateDFile
(
pWHeadf
,
true
)
<
0
)
{
tsdbError
(
"vgId:%d failed to create file %s to commit since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pWHeadf
),
tsdbError
(
"vgId:%d failed to create file %s to commit since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pWHeadf
),
tstrerror
(
terrno
));
tstrerror
(
terrno
));
...
@@ -554,7 +554,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
...
@@ -554,7 +554,7 @@ static int tsdbSetAndOpenCommitFile(SCommitH *pCommith, SDFileSet *pSet, int fid
}
}
}
}
}
else
{
}
else
{
tsdbInitDFile
(
p
WLastf
,
did
,
REPO_ID
(
pRepo
)
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)),
TSDB_FILE_LAST
);
tsdbInitDFile
(
p
Repo
,
pWLastf
,
did
,
fid
,
FS_TXN_VERSION
(
REPO_FS
(
pRepo
)),
TSDB_FILE_LAST
);
pCommith
->
isLFileSame
=
false
;
pCommith
->
isLFileSame
=
false
;
if
(
tsdbCreateDFile
(
pWLastf
,
true
)
<
0
)
{
if
(
tsdbCreateDFile
(
pWLastf
,
true
)
<
0
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbFS.c
浏览文件 @
cc556371
...
@@ -97,7 +97,7 @@ static int tsdbEncodeDFileSetArray(void **buf, SArray *pArray) {
...
@@ -97,7 +97,7 @@ static int tsdbEncodeDFileSetArray(void **buf, SArray *pArray) {
return
tlen
;
return
tlen
;
}
}
static
void
*
tsdbDecodeDFileSetArray
(
void
*
buf
,
SArray
*
pArray
)
{
static
void
*
tsdbDecodeDFileSetArray
(
STsdb
*
pRepo
,
void
*
buf
,
SArray
*
pArray
)
{
uint64_t
nset
;
uint64_t
nset
;
SDFileSet
dset
;
SDFileSet
dset
;
...
@@ -105,7 +105,7 @@ static void *tsdbDecodeDFileSetArray(void *buf, SArray *pArray) {
...
@@ -105,7 +105,7 @@ static void *tsdbDecodeDFileSetArray(void *buf, SArray *pArray) {
buf
=
taosDecodeFixedU64
(
buf
,
&
nset
);
buf
=
taosDecodeFixedU64
(
buf
,
&
nset
);
for
(
size_t
i
=
0
;
i
<
nset
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
nset
;
i
++
)
{
buf
=
tsdbDecodeDFileSet
(
buf
,
&
dset
);
buf
=
tsdbDecodeDFileSet
(
pRepo
,
buf
,
&
dset
);
taosArrayPush
(
pArray
,
(
void
*
)(
&
dset
));
taosArrayPush
(
pArray
,
(
void
*
)(
&
dset
));
}
}
return
buf
;
return
buf
;
...
@@ -122,13 +122,13 @@ static int tsdbEncodeFSStatus(void **buf, SFSStatus *pStatus) {
...
@@ -122,13 +122,13 @@ static int tsdbEncodeFSStatus(void **buf, SFSStatus *pStatus) {
return
tlen
;
return
tlen
;
}
}
static
void
*
tsdbDecodeFSStatus
(
void
*
buf
,
SFSStatus
*
pStatus
)
{
static
void
*
tsdbDecodeFSStatus
(
STsdb
*
pRepo
,
void
*
buf
,
SFSStatus
*
pStatus
)
{
tsdbResetFSStatus
(
pStatus
);
tsdbResetFSStatus
(
pStatus
);
// pStatus->pmf = &(pStatus->mf);
// pStatus->pmf = &(pStatus->mf);
// buf = tsdbDecodeSMFile(buf, pStatus->pmf);
// buf = tsdbDecodeSMFile(buf, pStatus->pmf);
buf
=
tsdbDecodeDFileSetArray
(
buf
,
pStatus
->
df
);
buf
=
tsdbDecodeDFileSetArray
(
pRepo
,
buf
,
pStatus
->
df
);
return
buf
;
return
buf
;
}
}
...
@@ -725,7 +725,7 @@ static int tsdbOpenFSFromCurrent(STsdb *pRepo) {
...
@@ -725,7 +725,7 @@ static int tsdbOpenFSFromCurrent(STsdb *pRepo) {
}
}
ptr
=
buffer
;
ptr
=
buffer
;
ptr
=
tsdbDecodeFSStatus
(
ptr
,
pStatus
);
ptr
=
tsdbDecodeFSStatus
(
p
Repo
,
p
tr
,
pStatus
);
}
else
{
}
else
{
tsdbResetFSStatus
(
pStatus
);
tsdbResetFSStatus
(
pStatus
);
}
}
...
@@ -913,7 +913,7 @@ static int tsdbScanRootDir(STsdb *pRepo) {
...
@@ -913,7 +913,7 @@ static int tsdbScanRootDir(STsdb *pRepo) {
const
STfsFile
*
pf
;
const
STfsFile
*
pf
;
tsdbGetRootDir
(
REPO_ID
(
pRepo
),
rootDir
);
tsdbGetRootDir
(
REPO_ID
(
pRepo
),
rootDir
);
STfsDir
*
tdir
=
tfsOpendir
(
rootDir
);
STfsDir
*
tdir
=
tfsOpendir
(
pRepo
->
pTfs
,
rootDir
);
if
(
tdir
==
NULL
)
{
if
(
tdir
==
NULL
)
{
tsdbError
(
"vgId:%d failed to open directory %s since %s"
,
REPO_ID
(
pRepo
),
rootDir
,
tstrerror
(
terrno
));
tsdbError
(
"vgId:%d failed to open directory %s since %s"
,
REPO_ID
(
pRepo
),
rootDir
,
tstrerror
(
terrno
));
return
-
1
;
return
-
1
;
...
@@ -947,7 +947,7 @@ static int tsdbScanDataDir(STsdb *pRepo) {
...
@@ -947,7 +947,7 @@ static int tsdbScanDataDir(STsdb *pRepo) {
const
STfsFile
*
pf
;
const
STfsFile
*
pf
;
tsdbGetDataDir
(
REPO_ID
(
pRepo
),
dataDir
);
tsdbGetDataDir
(
REPO_ID
(
pRepo
),
dataDir
);
STfsDir
*
tdir
=
tfsOpendir
(
dataDir
);
STfsDir
*
tdir
=
tfsOpendir
(
pRepo
->
pTfs
,
dataDir
);
if
(
tdir
==
NULL
)
{
if
(
tdir
==
NULL
)
{
tsdbError
(
"vgId:%d failed to open directory %s since %s"
,
REPO_ID
(
pRepo
),
dataDir
,
tstrerror
(
terrno
));
tsdbError
(
"vgId:%d failed to open directory %s since %s"
,
REPO_ID
(
pRepo
),
dataDir
,
tstrerror
(
terrno
));
return
-
1
;
return
-
1
;
...
...
source/dnode/vnode/src/tsdb/tsdbFile.c
浏览文件 @
cc556371
...
@@ -295,7 +295,7 @@ static int tsdbRollBackMFile(SMFile *pMFile) {
...
@@ -295,7 +295,7 @@ static int tsdbRollBackMFile(SMFile *pMFile) {
#endif
#endif
// ============== Operations on SDFile
// ============== Operations on SDFile
void
tsdbInitDFile
(
S
DFile
*
pDFile
,
SDiskID
did
,
int
v
id
,
int
fid
,
uint32_t
ver
,
TSDB_FILE_T
ftype
)
{
void
tsdbInitDFile
(
S
Tsdb
*
pRepo
,
SDFile
*
pDFile
,
SDiskID
d
id
,
int
fid
,
uint32_t
ver
,
TSDB_FILE_T
ftype
)
{
char
fname
[
TSDB_FILENAME_LEN
];
char
fname
[
TSDB_FILENAME_LEN
];
TSDB_FILE_SET_STATE
(
pDFile
,
TSDB_FILE_STATE_OK
);
TSDB_FILE_SET_STATE
(
pDFile
,
TSDB_FILE_STATE_OK
);
...
@@ -305,8 +305,8 @@ void tsdbInitDFile(SDFile *pDFile, SDiskID did, int vid, int fid, uint32_t ver,
...
@@ -305,8 +305,8 @@ void tsdbInitDFile(SDFile *pDFile, SDiskID did, int vid, int fid, uint32_t ver,
memset
(
&
(
pDFile
->
info
),
0
,
sizeof
(
pDFile
->
info
));
memset
(
&
(
pDFile
->
info
),
0
,
sizeof
(
pDFile
->
info
));
pDFile
->
info
.
magic
=
TSDB_FILE_INIT_MAGIC
;
pDFile
->
info
.
magic
=
TSDB_FILE_INIT_MAGIC
;
tsdbGetFilename
(
vi
d
,
fid
,
ver
,
ftype
,
fname
);
tsdbGetFilename
(
pRepo
->
vgI
d
,
fid
,
ver
,
ftype
,
fname
);
tfsInitFile
(
&
(
pDFile
->
f
),
did
.
level
,
did
.
id
,
fname
);
tfsInitFile
(
pRepo
->
pTfs
,
&
(
pDFile
->
f
),
d
id
,
fname
);
}
}
void
tsdbInitDFileEx
(
SDFile
*
pDFile
,
SDFile
*
pODFile
)
{
void
tsdbInitDFileEx
(
SDFile
*
pDFile
,
SDFile
*
pODFile
)
{
...
@@ -323,9 +323,9 @@ int tsdbEncodeSDFile(void **buf, SDFile *pDFile) {
...
@@ -323,9 +323,9 @@ int tsdbEncodeSDFile(void **buf, SDFile *pDFile) {
return
tlen
;
return
tlen
;
}
}
void
*
tsdbDecodeSDFile
(
void
*
buf
,
SDFile
*
pDFile
)
{
void
*
tsdbDecodeSDFile
(
STsdb
*
pRepo
,
void
*
buf
,
SDFile
*
pDFile
)
{
buf
=
tsdbDecodeDFInfo
(
buf
,
&
(
pDFile
->
info
));
buf
=
tsdbDecodeDFInfo
(
buf
,
&
(
pDFile
->
info
));
buf
=
tfsDecodeFile
(
buf
,
&
(
pDFile
->
f
));
buf
=
tfsDecodeFile
(
pRepo
->
pTfs
,
buf
,
&
(
pDFile
->
f
));
TSDB_FILE_SET_CLOSED
(
pDFile
);
TSDB_FILE_SET_CLOSED
(
pDFile
);
return
buf
;
return
buf
;
...
@@ -559,13 +559,13 @@ static int tsdbRollBackDFile(SDFile *pDFile) {
...
@@ -559,13 +559,13 @@ static int tsdbRollBackDFile(SDFile *pDFile) {
}
}
// ============== Operations on SDFileSet
// ============== Operations on SDFileSet
void
tsdbInitDFileSet
(
S
DFileSet
*
pSet
,
SDiskID
did
,
int
v
id
,
int
fid
,
uint32_t
ver
)
{
void
tsdbInitDFileSet
(
S
Tsdb
*
pRepo
,
SDFileSet
*
pSet
,
SDiskID
d
id
,
int
fid
,
uint32_t
ver
)
{
pSet
->
fid
=
fid
;
pSet
->
fid
=
fid
;
pSet
->
state
=
0
;
pSet
->
state
=
0
;
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
SDFile
*
pDFile
=
TSDB_DFILE_IN_SET
(
pSet
,
ftype
);
SDFile
*
pDFile
=
TSDB_DFILE_IN_SET
(
pSet
,
ftype
);
tsdbInitDFile
(
p
DFile
,
did
,
v
id
,
fid
,
ver
,
ftype
);
tsdbInitDFile
(
p
Repo
->
pTfs
,
pDFile
,
d
id
,
fid
,
ver
,
ftype
);
}
}
}
}
...
@@ -587,14 +587,14 @@ int tsdbEncodeDFileSet(void **buf, SDFileSet *pSet) {
...
@@ -587,14 +587,14 @@ int tsdbEncodeDFileSet(void **buf, SDFileSet *pSet) {
return
tlen
;
return
tlen
;
}
}
void
*
tsdbDecodeDFileSet
(
void
*
buf
,
SDFileSet
*
pSet
)
{
void
*
tsdbDecodeDFileSet
(
STsdb
*
pRepo
,
void
*
buf
,
SDFileSet
*
pSet
)
{
int32_t
fid
;
int32_t
fid
;
buf
=
taosDecodeFixedI32
(
buf
,
&
(
fid
));
buf
=
taosDecodeFixedI32
(
buf
,
&
(
fid
));
pSet
->
state
=
0
;
pSet
->
state
=
0
;
pSet
->
fid
=
fid
;
pSet
->
fid
=
fid
;
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
for
(
TSDB_FILE_T
ftype
=
0
;
ftype
<
TSDB_FILE_MAX
;
ftype
++
)
{
buf
=
tsdbDecodeSDFile
(
buf
,
TSDB_DFILE_IN_SET
(
pSet
,
ftype
));
buf
=
tsdbDecodeSDFile
(
pRepo
->
pTfs
,
buf
,
TSDB_DFILE_IN_SET
(
pSet
,
ftype
));
}
}
return
buf
;
return
buf
;
}
}
...
...
source/libs/tfs/src/tfs.c
浏览文件 @
cc556371
...
@@ -146,7 +146,7 @@ void tfsInitFile(STfs *pTfs, STfsFile *pFile, SDiskID diskId, const char *rname)
...
@@ -146,7 +146,7 @@ void tfsInitFile(STfs *pTfs, STfsFile *pFile, SDiskID diskId, const char *rname)
tstrncpy
(
pFile
->
rname
,
rname
,
TSDB_FILENAME_LEN
);
tstrncpy
(
pFile
->
rname
,
rname
,
TSDB_FILENAME_LEN
);
char
tmpName
[
TMPNAME_LEN
]
=
{
0
};
char
tmpName
[
TMPNAME_LEN
]
=
{
0
};
snprintf
(
tmpName
,
TMPNAME_LEN
,
"%s%s%s"
,
DISK_DIR
(
pDisk
)
,
TD_DIRSEP
,
rname
);
snprintf
(
tmpName
,
TMPNAME_LEN
,
"%s%s%s"
,
pDisk
->
path
,
TD_DIRSEP
,
rname
);
tstrncpy
(
pFile
->
aname
,
tmpName
,
TSDB_FILENAME_LEN
);
tstrncpy
(
pFile
->
aname
,
tmpName
,
TSDB_FILENAME_LEN
);
pFile
->
pTfs
=
pTfs
;
pFile
->
pTfs
=
pTfs
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录