You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/10/22 08:01:43 UTC
[GitHub] [incubator-kvrocks] mapleFU commented on pull request #1026: [WIP] Support `config set backup-dir new-dir`
mapleFU commented on PR #1026:
URL: https://github.com/apache/incubator-kvrocks/pull/1026#issuecomment-1287671317
@git-hulk in current implementions, a `config set backup-dir ...` might blocked by a backup or a purge. And the `backup_mu_` is moved to `Config`. And the `backup_creating_time_` will not be changed if config is changed, so it's still a bit trickey.
If we don't want blocked by a backup, `backup_mu_` should have less critical sections, like:
```
config_set():
grab backup_mu_
set config
reset backup_creating_time_ if storage_ != nullptr
backup():
grab backup_mu_
test backup_flag:
return if backup_flag is True
set backup_flag
get config
release backup_mu_
do backup
grab backup_mu_
unset backup_flag
if failed:
return
if config->backup-dir changed:
return
set backup_creating_time_
purge():
grab backup_mu_
test backup_flag and backup_creating_time_:
return if backup_flag is True or backup_creating_time_ is not too old
set backup_flag
get config
release backup_mu_
pruge files
grab backup_mu_
unset backup_flag
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org