Skip to content

Commit

Permalink
Avoid spliting txn shards
Browse files Browse the repository at this point in the history
  • Loading branch information
w41ter committed Nov 21, 2024
1 parent 0c8e35b commit 3060978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/src/root/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl ScheduleContext {
Ok(SchedResult::ack())
}

/// Handle the spliting shard stask and update the sched stats.
/// Handle the spliting shard shards and update the sched stats.
async fn handle_split_shard(&self, task: &mut SplitShardTask) -> Result<SchedResult> {
let result = self.handle_split_shard_inner(task).await?;
if result.ack {
Expand Down
4 changes: 4 additions & 0 deletions src/server/src/root/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ impl ClusterStats {
continue;
}
if let Some(&group_id) = table_stats.shard_indexes.get(&shard_stats.shard_id) {
if group_id == sekas_schema::ROOT_GROUP_ID {
// Don't split the root groups, such as txn shard.
continue;
}
target_shards.push((group_id, shard_stats.shard_id));
if target_shards.len() >= limit {
break;
Expand Down

0 comments on commit 3060978

Please sign in to comment.