From 80e6049ad393fea8484376718216728f3d802324 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Mon, 13 Nov 2023 10:02:57 +0000 Subject: [PATCH] chore: remove remark_inactive_region field --- src/meta-srv/src/procedure/region_failover.rs | 8 +------- .../src/procedure/region_failover/activate_region.rs | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/meta-srv/src/procedure/region_failover.rs b/src/meta-srv/src/procedure/region_failover.rs index a09bb1c2c0c4..fde254ea7084 100644 --- a/src/meta-srv/src/procedure/region_failover.rs +++ b/src/meta-srv/src/procedure/region_failover.rs @@ -270,8 +270,6 @@ trait State: Sync + Send + Debug { fn status(&self) -> Status { Status::executing(true) } - - fn remark_inactive_region_if_needed(&mut self) {} } /// The states transition of region failover procedure: @@ -341,11 +339,7 @@ impl RegionFailoverProcedure { } fn from_json(json: &str, context: RegionFailoverContext) -> ProcedureResult { - let mut node: Node = serde_json::from_str(json).context(FromJsonSnafu)?; - // If the meta leader node dies during the execution of the procedure, - // the new leader node needs to remark the failed region as "inactive" - // to prevent it from renewing the lease. - node.state.remark_inactive_region_if_needed(); + let node: Node = serde_json::from_str(json).context(FromJsonSnafu)?; Ok(Self { node, context }) } } diff --git a/src/meta-srv/src/procedure/region_failover/activate_region.rs b/src/meta-srv/src/procedure/region_failover/activate_region.rs index 9a7fb13a317f..b758524018b9 100644 --- a/src/meta-srv/src/procedure/region_failover/activate_region.rs +++ b/src/meta-srv/src/procedure/region_failover/activate_region.rs @@ -176,10 +176,6 @@ impl State for ActivateRegion { self.handle_response(mailbox_receiver, failed_region).await } - - fn remark_inactive_region_if_needed(&mut self) { - self.remark_inactive_region = true; - } } #[cfg(test)]