Skip to content

Commit

Permalink
chore: remove remark_inactive_region field
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Nov 13, 2023
1 parent 8ee7682 commit 80e6049
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 1 addition & 7 deletions src/meta-srv/src/procedure/region_failover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -341,11 +339,7 @@ impl RegionFailoverProcedure {
}

fn from_json(json: &str, context: RegionFailoverContext) -> ProcedureResult<Self> {
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 })
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/meta-srv/src/procedure/region_failover/activate_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 80e6049

Please sign in to comment.