Skip to content

Commit

Permalink
disk_snapshot_backup: pause raft log GC while backing up (tikv#16519)
Browse files Browse the repository at this point in the history
close tikv#16518

This PR will pause the `CompactLog` admin command during backing up.

Signed-off-by: Yu Juncen <yu745514916@live.com>
  • Loading branch information
YuJuncen committed Feb 20, 2024
1 parent 433aa74 commit c66c698
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/raftstore/src/store/snapshot_backup.rs
Expand Up @@ -233,11 +233,9 @@ impl AdminObserver for Arc<PrepareDiskSnapObserver> {
if self.allowed() {
return Ok(());
}
// NOTE: We should disable `CompactLog` here because if the log get truncated,
// NOTE: We have disabled `CompactLog` here because if the log get truncated,
// we may take a long time to send snapshots during restoring.
//
// However it may impact the TP workload if we are preparing for a long time.
// With this risk, we need more evidence of its adventage to reject CompactLogs.
// Also note it may impact the TP workload if we are preparing for a long time.
let should_reject = matches!(
admin.get_cmd_type(),
AdminCmdType::Split |
Expand All @@ -249,7 +247,8 @@ impl AdminObserver for Arc<PrepareDiskSnapObserver> {
AdminCmdType::PrepareMerge |
AdminCmdType::ChangePeer |
AdminCmdType::ChangePeerV2 |
AdminCmdType::BatchSwitchWitness
AdminCmdType::BatchSwitchWitness |
AdminCmdType::CompactLog
);
if should_reject {
metrics::SNAP_BR_SUSPEND_COMMAND_TYPE
Expand Down

0 comments on commit c66c698

Please sign in to comment.