mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
Speed up compute shutdown
This commit is contained in:
@@ -294,6 +294,14 @@ fn main() -> Result<()> {
|
||||
info!("synced safekeepers at lsn {lsn}");
|
||||
}
|
||||
|
||||
// Change status to GracefulShutdown
|
||||
{
|
||||
let mut state = compute.state.lock().unwrap();
|
||||
if matches!(state.status, ComputeStatus::Running) {
|
||||
state.status = ComputeStatus::GracefulShutdown;
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(err) = compute.check_for_core_dumps() {
|
||||
error!("error while checking for core dumps: {err:?}");
|
||||
}
|
||||
|
||||
@@ -568,6 +568,7 @@ impl Endpoint {
|
||||
}
|
||||
ComputeStatus::Empty
|
||||
| ComputeStatus::ConfigurationPending
|
||||
| ComputeStatus::GracefulShutdown
|
||||
| ComputeStatus::Configuration => {
|
||||
bail!("unexpected compute status: {:?}", state.status)
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ pub enum ComputeStatus {
|
||||
// compute will exit soon or is waiting for
|
||||
// control-plane to terminate it.
|
||||
Failed,
|
||||
// Wrapping up without blocking the next compute
|
||||
// start, which might be scheduled on a different
|
||||
// compute node
|
||||
GracefulShutdown,
|
||||
}
|
||||
|
||||
fn rfc3339_serialize<S>(x: &Option<DateTime<Utc>>, s: S) -> Result<S::Ok, S::Error>
|
||||
|
||||
Reference in New Issue
Block a user