-
Notifications
You must be signed in to change notification settings - Fork 58
replica-server: remove checkpoint dirs when cold backup completed #216
Conversation
现在冷备份完成后,backup所使用的checkpoint文件夹会一直保留着,占据不必要的存储空间,几乎让存储用量增大一倍。 |
", old_backup_status = %s", | ||
new_context->name, | ||
backup_context->request.backup_id, | ||
cold_backup_status_to_string(backup_status)); | ||
backup_context->cancel(); | ||
_cold_backup_contexts.erase(policy_name); | ||
on_cold_backup(request, response); | ||
if (backup_id != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在的backup_id是开始备份的时间戳吧?所以肯定不是0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,是时间戳
if (status() == partition_status::type::PS_PRIMARY || | ||
status() == partition_status::type::PS_SECONDARY) { | ||
cold_backup_context_ptr backup_context = nullptr; | ||
auto find = _cold_backup_contexts.find(policy_name); | ||
if (find != _cold_backup_contexts.end()) { | ||
backup_context = find->second; | ||
} else { | ||
if (backup_id == 0) { | ||
if (status() == partition_status::type::PS_PRIMARY) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这个 check 应该放在 send_backup_request_to_secondary 里面,这样就不用每次调用都写一遍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也就多写一遍,而且外面确实就需要检查一下,调用这个函数的角色就应当是primary
} | ||
|
||
for (std::string &d : sub_dirs) { | ||
std::string dirname = ::dsn::utils::filesystem::get_file_name(d); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉 ::dsn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -181,7 +181,7 @@ client:begin_write:id=169,key=k169,value=v169,timeout=0 | |||
inject:on_aio_call:node=r2,task_code=LPC_WRITE_REPLICATION_LOG_SHARED | |||
config:{4,r1,[r3]} | |||
|
|||
state:{{r1,pri,4,24},{r3,sec,4,21}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 case 改动是啥原因?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为代码发生变化,造成这里的表现和原来不一致了,导致travis上测试失败。act测试现在就是有这个问题,有些不确定性,后面需要改进一下。
to release storage resouces as soon as possiable.