Skip to content

Commit

Permalink
fix: use RegionId region number instead
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Aug 28, 2023
1 parent ef75e8f commit 16a5fe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/meta-srv/src/procedure/region_failover/update_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl UpdateRegionMetadata {
let mut new_region_routes = table_route_value.region_routes.clone();

for region_route in new_region_routes.iter_mut() {
if region_route.region.id == failed_region.region_number as u64 {
if region_route.region.id.region_number() == failed_region.region_number {
region_route.leader_peer = Some(self.candidate.clone());
break;
}
Expand Down Expand Up @@ -159,7 +159,7 @@ mod tests {
use super::super::tests::{TestingEnv, TestingEnvBuilder};
use super::{State, *};
use crate::test_util::new_region_route;

#[tokio::test]
async fn test_next_state() {
let env = TestingEnvBuilder::new().build().await;
Expand Down

0 comments on commit 16a5fe5

Please sign in to comment.