-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support redis(standalone replica) pitr #961
Conversation
@Y-Rookie could you take a look? |
@@ -43,9 +43,10 @@ appendfsync everysec | |||
no-appendfsync-on-rewrite no | |||
auto-aof-rewrite-percentage 100 | |||
auto-aof-rewrite-min-size 64mb | |||
aof-disable-auto-gc no |
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.
What is the default value of this parameter? And what is its purpose? I couldn't find it in the official redis.conf file. This issue: redis/redis#10561 mentions that it is just a testing parameter that exists in the internal code.
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.
the default value is no
, I mentioned this parameter just to clarify that I used this parameter. I actually set the parameter to yes
in the backup target pod only while the users trigger the PITR. As I see, using the testing parameter doesn't affect the existing cluster and the users who don't need PITR.
Hi @Chiwency , after some discussion with my colleges. we suggested:
|
@shanshanying I get it.
|
Hi @Chiwency,
The point is: if the change of parameters will affect exsitng RUNNING redis clusters, we'd better change is in a more EXPLICIT way: tell users how to modify the values mannuly, either by OpsRequest, or edit some configmap, and write a doc to explain the side-effect. |
Hi @shanshanying
kbcli cluster update <redis-cluster-name> --backup-enabled=true --backup-method=aof
kbcli cluster edit-config <redis-cluster-name>
kbcli cluster update <redis-cluster-name> --backup-enabled=true --backup-method=aof Whether it's Option 1 or Option 2, documentation will be provided later to explain the changes. My key question here is whether these parameters should be managed by the users, do these parameter modifications count as affecting the existing cluster? |
two independent operations is better for open-source users, first to set the flag, and then use the PITR, if one use PITR with aof timestamp disabled, please return an error code and exits immediately. |
DP_save_backup_status_info "${total_size}" "${start_time}" "$(date +%s)" | ||
} | ||
|
||
function check_conf() { |
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.
Also check the aof-timestamp-enabled here, it can fail and return an error when both either of them is disabled. Prompt the user to manually edit the config items with 'kbcli edit-config' or 'kubectl + reconfigure ops'
Hi @nayutah |
We leverage the AOF backup feature from Redis version 7.0 onwards to implement Point-In-Time Recovery (PITR). By enabling the
aof-timestamp-enabled yes
andaof-disable-auto-gc no
parameters, we activate AOF timestamp annotations while disabling the automatic cleanup of historical AOF files. A StatefulSet, which is continuously responsible for the ongoing backup process, manages and tracks the AOF files.The continuous backup process works as follows:
${base_file_ctime}.${seq}.${suffix}
, wherebase_file_ctime
is the creation time of the base aof file, marking the start of this particular backup package. This timestamp creates a continuous timeline for all backups. Theseq
is a sequence number used for recovery in case of a backup pod failure.The recovery process works as follows:
DP_RESTORE_TIME
, the backup package with thebase_file_ctime
closest toDP_RESTORE_TIME
is selected. This base file's data is used as the starting point. Then, AOF files are processed according to their timestamp annotations , up untilDP_RESTORE_TIME
is reached.