Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bd758e02
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd758e02
编写于
8月 15, 2023
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
retention: remove old files last
上级
8639c22c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
14 deletion
+22
-14
source/dnode/vnode/src/inc/vndCos.h
source/dnode/vnode/src/inc/vndCos.h
+1
-1
source/dnode/vnode/src/tsdb/tsdbRetention.c
source/dnode/vnode/src/tsdb/tsdbRetention.c
+12
-11
source/dnode/vnode/src/vnd/vnodeCos.c
source/dnode/vnode/src/vnd/vnodeCos.c
+9
-2
未找到文件。
source/dnode/vnode/src/inc/vndCos.h
浏览文件 @
bd758e02
...
...
@@ -26,7 +26,7 @@ extern int8_t tsS3Enabled;
int32_t
s3Init
();
void
s3CleanUp
();
void
s3PutObjectFromFile
(
const
char
*
file
,
const
char
*
object
);
int32_t
s3PutObjectFromFile
(
const
char
*
file
,
const
char
*
object
);
void
s3DeleteObjects
(
const
char
*
object_name
[],
int
nobject
);
bool
s3Exists
(
const
char
*
object_name
);
bool
s3Get
(
const
char
*
object_name
,
const
char
*
path
);
...
...
source/dnode/vnode/src/tsdb/tsdbRetention.c
浏览文件 @
bd758e02
...
...
@@ -114,7 +114,8 @@ static int32_t tsdbCopyFileS3(SRTNer *rtner, const STFileObj *from, const STFile
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
char
*
object_name
=
taosDirEntryBaseName
(
fname
);
s3PutObjectFromFile
(
from
->
fname
,
object_name
);
code
=
s3PutObjectFromFile
(
from
->
fname
,
object_name
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
taosCloseFile
(
&
fdFrom
);
...
...
@@ -178,16 +179,6 @@ static int32_t tsdbMigrateDataFileS3(SRTNer *rtner, const STFileObj *fobj, const
int32_t
lino
=
0
;
STFileOp
op
=
{
0
};
// remove old
op
=
(
STFileOp
){
.
optype
=
TSDB_FOP_REMOVE
,
.
fid
=
fobj
->
f
->
fid
,
.
of
=
fobj
->
f
[
0
],
};
code
=
TARRAY2_APPEND
(
rtner
->
fopArr
,
op
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// create new
op
=
(
STFileOp
){
.
optype
=
TSDB_FOP_CREATE
,
...
...
@@ -213,6 +204,16 @@ static int32_t tsdbMigrateDataFileS3(SRTNer *rtner, const STFileObj *fobj, const
code
=
tsdbCopyFileS3
(
rtner
,
fobj
,
&
op
.
nf
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// remove old
op
=
(
STFileOp
){
.
optype
=
TSDB_FOP_REMOVE
,
.
fid
=
fobj
->
f
->
fid
,
.
of
=
fobj
->
f
[
0
],
};
code
=
TARRAY2_APPEND
(
rtner
->
fopArr
,
op
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
_exit:
if
(
code
)
{
TSDB_ERROR_LOG
(
TD_VID
(
rtner
->
tsdb
->
pVnode
),
lino
,
code
);
...
...
source/dnode/vnode/src/vnd/vnodeCos.c
浏览文件 @
bd758e02
...
...
@@ -51,7 +51,8 @@ static void s3InitRequestOptions(cos_request_options_t *options, int is_cname) {
options
->
ctl
=
cos_http_controller_create
(
options
->
pool
,
0
);
}
void
s3PutObjectFromFile
(
const
char
*
file_str
,
const
char
*
object_str
)
{
int32_t
s3PutObjectFromFile
(
const
char
*
file_str
,
const
char
*
object_str
)
{
int32_t
code
=
0
;
cos_pool_t
*
p
=
NULL
;
int
is_cname
=
0
;
cos_status_t
*
s
=
NULL
;
...
...
@@ -76,6 +77,12 @@ void s3PutObjectFromFile(const char *file_str, const char *object_str) {
log_status
(
s
);
cos_pool_destroy
(
p
);
if
(
s
->
code
!=
200
)
{
return
code
=
s
->
code
;
}
return
code
;
}
void
s3DeleteObjects
(
const
char
*
object_name
[],
int
nobject
)
{
...
...
@@ -300,7 +307,7 @@ long s3Size(const char *object_name) {
int32_t
s3Init
()
{
return
0
;
}
void
s3CleanUp
()
{}
void
s3PutObjectFromFile
(
const
char
*
file
,
const
char
*
object
)
{
}
int32_t
s3PutObjectFromFile
(
const
char
*
file
,
const
char
*
object
)
{
return
0
;
}
void
s3DeleteObjects
(
const
char
*
object_name
[],
int
nobject
)
{}
bool
s3Exists
(
const
char
*
object_name
)
{
return
false
;
}
bool
s3Get
(
const
char
*
object_name
,
const
char
*
path
)
{
return
false
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录