Skip to content

Commit

Permalink
tikv-ctl: Don't send compact commands to TiFlash stores (#16190)
Browse files Browse the repository at this point in the history
close #16189

tikv-ctl compact-cluster now works with clusters that have TiFlash nodes

Signed-off-by: Fred Wulff <frew@cs.stanford.edu>

Co-authored-by: tonyxuqqi <tonyxuqi@outlook.com>
  • Loading branch information
frew and tonyxuqqi committed Jan 10, 2024
1 parent 4a77d18 commit c041ee3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/tikv-ctl/src/main.rs
Expand Up @@ -796,12 +796,18 @@ fn compact_whole_cluster(
threads: u32,
bottommost: BottommostLevelCompaction,
) {
let stores = pd_client
let all_stores = pd_client
.get_all_stores(true) // Exclude tombstone stores.
.unwrap_or_else(|e| perror_and_exit("Get all cluster stores from PD failed", e));

let tikv_stores = all_stores.iter().filter(|s| {
!s.get_labels()
.iter()
.any(|l| l.get_key() == "engine" && l.get_value() == "tiflash")
});

let mut handles = Vec::new();
for s in stores {
for s in tikv_stores {
let cfg = cfg.clone();
let mgr = Arc::clone(&mgr);
let addr = s.address.clone();
Expand Down

0 comments on commit c041ee3

Please sign in to comment.