-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Closed
Copy link
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Development Task
tikv/components/raftstore/src/store/fsm/apply.rs
Lines 874 to 883 in 403ce52
| fn should_sync_log(cmd: &RaftCmdRequest) -> bool { | |
| if cmd.has_admin_request() { | |
| if cmd.get_admin_request().get_cmd_type() == AdminCmdType::CompactLog { | |
| // We do not need to sync WAL before compact log, because this request will send | |
| // a msg to raft_gc_log thread to delete the entries before this | |
| // index instead of deleting them in apply thread directly. | |
| return false; | |
| } | |
| return true; | |
| } |
The current implementation of apply threads in the Raft store synchronizes the Write-Ahead Log (WAL) for all admin commands except CompactLog. This synchronization is unnecessary for read-only admin commands like TransferLeader, leading to potential latency spikes, particularly during leader transfers triggered by slow disk detection.
By excluding TransferLeader from WAL synchronization, TiKV can reduce unnecessary I/O operations, thereby mitigating latency spikes during leader transfers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.