Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e209b487
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看板
提交
e209b487
编写于
7月 13, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: rename func name vnodeGetPrimaryDir
上级
b7e134af
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
26 addition
and
26 deletion
+26
-26
source/dnode/vnode/src/inc/vnd.h
source/dnode/vnode/src/inc/vnd.h
+1
-1
source/dnode/vnode/src/meta/metaOpen.c
source/dnode/vnode/src/meta/metaOpen.c
+1
-1
source/dnode/vnode/src/sma/smaFS.c
source/dnode/vnode/src/sma/smaFS.c
+2
-2
source/dnode/vnode/src/sma/smaUtil.c
source/dnode/vnode/src/sma/smaUtil.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbFS.c
source/dnode/vnode/src/tsdb/tsdbFS.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbFile.c
source/dnode/vnode/src/tsdb/tsdbFile.c
+1
-1
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+4
-4
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+7
-7
source/dnode/vnode/src/vnd/vnodeRetention.c
source/dnode/vnode/src/vnd/vnodeRetention.c
+2
-2
source/dnode/vnode/src/vnd/vnodeSnapshot.c
source/dnode/vnode/src/vnd/vnodeSnapshot.c
+3
-3
未找到文件。
source/dnode/vnode/src/inc/vnd.h
浏览文件 @
e209b487
...
...
@@ -87,7 +87,7 @@ void vnodeBufPoolAddToFreeList(SVBufPool* pPool);
int32_t
vnodeBufPoolRecycle
(
SVBufPool
*
pPool
);
// vnodeOpen.c
int32_t
vnodeGet
Abs
Dir
(
const
char
*
relPath
,
STfs
*
pTfs
,
char
*
buf
,
size_t
bufLen
);
int32_t
vnodeGet
Primary
Dir
(
const
char
*
relPath
,
STfs
*
pTfs
,
char
*
buf
,
size_t
bufLen
);
// vnodeQuery.c
int32_t
vnodeQueryOpen
(
SVnode
*
pVnode
);
...
...
source/dnode/vnode/src/meta/metaOpen.c
浏览文件 @
e209b487
...
...
@@ -41,7 +41,7 @@ int metaOpen(SVnode *pVnode, SMeta **ppMeta, int8_t rollback) {
*
ppMeta
=
NULL
;
// create handle
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
path
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
path
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
path
);
snprintf
(
path
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%s%s"
,
TD_DIRSEP
,
VNODE_META_DIR
);
...
...
source/dnode/vnode/src/sma/smaFS.c
浏览文件 @
e209b487
...
...
@@ -160,11 +160,11 @@ static void tdRSmaGetCurrentFName(SSma *pSma, char *current, char *current_t) {
SVnode
*
pVnode
=
pSma
->
pVnode
;
int32_t
offset
=
0
;
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
current
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
current
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
current
);
snprintf
(
current
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%srsma%sPRESENT"
,
TD_DIRSEP
,
TD_DIRSEP
);
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
current_t
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
current_t
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
current_t
);
snprintf
(
current_t
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%srsma%sPRESENT.t"
,
TD_DIRSEP
,
TD_DIRSEP
);
}
...
...
source/dnode/vnode/src/sma/smaUtil.c
浏览文件 @
e209b487
...
...
@@ -44,7 +44,7 @@ void tdRSmaGetFileName(SVnode *pVnode, STfs *pTfs, const char *fname, int64_t su
int32_t
offset
=
0
;
// vnode
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pTfs
,
outputName
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pTfs
,
outputName
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
outputName
);
// rsma
...
...
@@ -74,7 +74,7 @@ void tdRSmaGetDirName(SVnode *pVnode, STfs *pTfs, bool endWithSep, char *outputN
int32_t
offset
=
0
;
// vnode
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pTfs
,
outputName
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pTfs
,
outputName
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
outputName
);
// rsma
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
e209b487
...
...
@@ -59,7 +59,7 @@ typedef struct {
static
void
tsdbGetRocksPath
(
STsdb
*
pTsdb
,
char
*
path
)
{
SVnode
*
pVnode
=
pTsdb
->
pVnode
;
vnodeGet
Abs
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
path
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
path
,
TSDB_FILENAME_LEN
);
int32_t
offset
=
strlen
(
path
);
snprintf
(
path
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%scache.rdb"
,
TD_DIRSEP
);
...
...
source/dnode/vnode/src/tsdb/tsdbFS.c
浏览文件 @
e209b487
...
...
@@ -276,14 +276,14 @@ static void tsdbGetCurrentFName(STsdb *pTsdb, char *current, char *current_t) {
// CURRENT
if
(
current
)
{
vnodeGet
Abs
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
current
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
current
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
current
);
snprintf
(
current
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%sCURRENT"
,
TD_DIRSEP
);
}
// CURRENT.t
if
(
current_t
)
{
vnodeGet
Abs
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
current_t
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pTsdb
->
path
,
pVnode
->
pTfs
,
current_t
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
current_t
);
snprintf
(
current_t
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%sCURRENT.t"
,
TD_DIRSEP
);
}
...
...
source/dnode/vnode/src/tsdb/tsdbFile.c
浏览文件 @
e209b487
...
...
@@ -285,7 +285,7 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
void
tsdbDelFileName
(
STsdb
*
pTsdb
,
SDelFile
*
pFile
,
char
fname
[])
{
int32_t
offset
=
0
;
vnodeGet
Abs
Dir
(
pTsdb
->
path
,
pTsdb
->
pVnode
->
pTfs
,
fname
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pTsdb
->
path
,
pTsdb
->
pVnode
->
pTfs
,
fname
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
fname
);
snprintf
((
char
*
)
fname
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%sv%dver%"
PRId64
".del"
,
TD_DIRSEP
,
TD_VID
(
pTsdb
->
pVnode
),
pFile
->
commitID
);
...
...
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
e209b487
...
...
@@ -290,7 +290,7 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) {
pInfo
->
txn
=
metaGetTxn
(
pVnode
->
pMeta
);
// save info
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vDebug
(
"vgId:%d, save config while prepare commit"
,
TD_VID
(
pVnode
));
if
(
vnodeSaveInfo
(
dir
,
&
pInfo
->
info
)
<
0
)
{
...
...
@@ -423,7 +423,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
return
-
1
;
}
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
syncBeginSnapshot
(
pVnode
->
sync
,
pInfo
->
info
.
state
.
committed
);
...
...
@@ -487,7 +487,7 @@ bool vnodeShouldRollback(SVnode *pVnode) {
char
tFName
[
TSDB_FILENAME_LEN
]
=
{
0
};
int32_t
offset
=
0
;
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
tFName
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
tFName
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
tFName
);
snprintf
(
tFName
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%s%s"
,
TD_DIRSEP
,
VND_INFO_FNAME_TMP
);
...
...
@@ -498,7 +498,7 @@ void vnodeRollback(SVnode *pVnode) {
char
tFName
[
TSDB_FILENAME_LEN
]
=
{
0
};
int32_t
offset
=
0
;
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
tFName
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
tFName
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
tFName
);
snprintf
(
tFName
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%s%s"
,
TD_DIRSEP
,
VND_INFO_FNAME_TMP
);
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
e209b487
...
...
@@ -15,7 +15,7 @@
#include "vnd.h"
int32_t
vnodeGet
Abs
Dir
(
const
char
*
relPath
,
STfs
*
pTfs
,
char
*
buf
,
size_t
bufLen
)
{
int32_t
vnodeGet
Primary
Dir
(
const
char
*
relPath
,
STfs
*
pTfs
,
char
*
buf
,
size_t
bufLen
)
{
if
(
pTfs
)
{
snprintf
(
buf
,
bufLen
-
1
,
"%s%s%s"
,
tfsGetPrimaryPath
(
pTfs
),
TD_DIRSEP
,
relPath
);
}
else
{
...
...
@@ -36,7 +36,7 @@ int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) {
}
// create vnode env
vnodeGet
Abs
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
if
(
taosMkDir
(
dir
))
{
return
TAOS_SYSTEM_ERROR
(
errno
);
}
...
...
@@ -65,7 +65,7 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, STfs *p
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
int32_t
ret
=
0
;
vnodeGet
Abs
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
ret
=
vnodeLoadInfo
(
dir
,
&
info
);
if
(
ret
<
0
)
{
...
...
@@ -188,7 +188,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
int32_t
ret
=
0
;
vnodeGet
Abs
Dir
(
srcPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
srcPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
ret
=
vnodeLoadInfo
(
dir
,
&
info
);
if
(
ret
<
0
)
{
...
...
@@ -247,7 +247,7 @@ int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t s
SVnodeInfo
info
=
{
0
};
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeGet
Abs
Dir
(
dstPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
dstPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
if
(
vnodeLoadInfo
(
dir
,
&
info
)
==
0
)
{
if
(
info
.
config
.
vgId
!=
dstVgId
)
{
vError
(
"vgId:%d, unexpected vnode config.vgId:%d"
,
dstVgId
,
info
.
config
.
vgId
);
...
...
@@ -256,7 +256,7 @@ int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t s
return
dstVgId
;
}
vnodeGet
Abs
Dir
(
srcPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
srcPath
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
if
(
vnodeLoadInfo
(
dir
,
&
info
)
<
0
)
{
vError
(
"vgId:%d, failed to read vnode config from %s since %s"
,
srcVgId
,
srcPath
,
tstrerror
(
terrno
));
return
-
1
;
...
...
@@ -291,7 +291,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
char
tdir
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
int32_t
ret
=
0
;
vnodeGet
Abs
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
path
,
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
info
.
config
=
vnodeCfgDefault
;
...
...
source/dnode/vnode/src/vnd/vnodeRetention.c
浏览文件 @
e209b487
...
...
@@ -35,7 +35,7 @@ static int32_t vnodePrepareRentention(SVnode *pVnode, SRetentionInfo *pInfo) {
pInfo
->
commitID
=
++
pVnode
->
state
.
commitID
;
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
if
(
vnodeLoadInfo
(
dir
,
&
pInfo
->
info
)
<
0
)
{
code
=
terrno
;
...
...
@@ -60,7 +60,7 @@ static int32_t vnodeRetentionTask(void *param) {
SVnode
*
pVnode
=
pInfo
->
pVnode
;
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
// save info
pInfo
->
info
.
state
.
commitID
=
pInfo
->
commitID
;
...
...
source/dnode/vnode/src/vnd/vnodeSnapshot.c
浏览文件 @
e209b487
...
...
@@ -93,7 +93,7 @@ int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData)
char
fName
[
TSDB_FILENAME_LEN
];
int32_t
offset
=
0
;
vnodeGet
Abs
Dir
(
pReader
->
pVnode
->
path
,
pReader
->
pVnode
->
pTfs
,
fName
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pReader
->
pVnode
->
path
,
pReader
->
pVnode
->
pTfs
,
fName
,
TSDB_FILENAME_LEN
);
offset
=
strlen
(
fName
);
snprintf
(
fName
+
offset
,
TSDB_FILENAME_LEN
-
offset
-
1
,
"%s%s"
,
TD_DIRSEP
,
VND_INFO_FNAME
);
...
...
@@ -343,7 +343,7 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot *
.
applyTerm
=
pWriter
->
info
.
state
.
commitTerm
};
pVnode
->
statis
=
pWriter
->
info
.
statis
;
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeGet
Abs
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pVnode
->
path
,
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeCommitInfo
(
dir
);
}
else
{
...
...
@@ -395,7 +395,7 @@ static int32_t vnodeSnapWriteInfo(SVSnapWriter *pWriter, uint8_t *pData, uint32_
// modify info as needed
char
dir
[
TSDB_FILENAME_LEN
]
=
{
0
};
vnodeGet
Abs
Dir
(
pWriter
->
pVnode
->
path
,
pWriter
->
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
vnodeGet
Primary
Dir
(
pWriter
->
pVnode
->
path
,
pWriter
->
pVnode
->
pTfs
,
dir
,
TSDB_FILENAME_LEN
);
SVnodeStats
vndStats
=
pWriter
->
info
.
config
.
vndStats
;
SVnode
*
pVnode
=
pWriter
->
pVnode
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录