compute_ctl: add flag to avoid config step (#4457)

Add backwards-compatible flag that cplane can use to speed up startup time
This commit is contained in:
bojanserafimov
2023-06-12 13:57:02 -04:00
committed by GitHub
parent 939593d0d3
commit 4936ab6842
3 changed files with 8 additions and 1 deletions

View File

@@ -442,7 +442,7 @@ impl ComputeNode {
let pg = self.start_postgres(spec.storage_auth_token.clone())?;
if spec.spec.mode == ComputeMode::Primary {
if spec.spec.mode == ComputeMode::Primary && !spec.spec.skip_pg_catalog_updates {
self.apply_config(&compute_state)?;
}

View File

@@ -450,6 +450,7 @@ impl Endpoint {
// Create spec file
let spec = ComputeSpec {
skip_pg_catalog_updates: false,
format_version: 1.0,
operation_uuid: None,
cluster: Cluster {

View File

@@ -27,6 +27,12 @@ pub struct ComputeSpec {
pub cluster: Cluster,
pub delta_operations: Option<Vec<DeltaOp>>,
/// An optinal hint that can be passed to speed up startup time if we know
/// that no pg catalog mutations (like role creation, database creation,
/// extension creation) need to be done on the actual database to start.
#[serde(default)] // Default false
pub skip_pg_catalog_updates: bool,
// Information needed to connect to the storage layer.
//
// `tenant_id`, `timeline_id` and `pageserver_connstring` are always needed.