Skip to content

Commit

Permalink
Remove primary_is_running (#8162)
Browse files Browse the repository at this point in the history
This was a half-finished mechanism to allow a replica to enter hot
standby mode sooner, without waiting for a running-xacts record. It had
issues, and we are working on a better mechanism to replace it.

The control plane might still set the flag in the spec file, but
compute_ctl will simply ignore it.
  • Loading branch information
hlinnaka authored Jun 26, 2024
1 parent 9b623d3 commit fdadd6a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 24 deletions.
6 changes: 0 additions & 6 deletions compute_tools/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ pub fn write_postgres_conf(
ComputeMode::Replica => {
// hot_standby is 'on' by default, but let's be explicit
writeln!(file, "hot_standby=on")?;

// Inform the replica about the primary state
// Default is 'false'
if let Some(primary_is_running) = spec.primary_is_running {
writeln!(file, "neon.primary_is_running={}", primary_is_running)?;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion control_plane/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ impl Endpoint {
remote_extensions,
pgbouncer_settings: None,
shard_stripe_size: Some(shard_stripe_size),
primary_is_running: None,
};
let spec_path = self.endpoint_path().join("spec.json");
std::fs::write(spec_path, serde_json::to_string_pretty(&spec)?)?;
Expand Down
6 changes: 0 additions & 6 deletions libs/compute_api/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ pub struct ComputeSpec {
// Stripe size for pageserver sharding, in pages
#[serde(default)]
pub shard_stripe_size: Option<usize>,

// When we are starting a new replica in hot standby mode,
// we need to know if the primary is running.
// This is used to determine if replica should wait for
// RUNNING_XACTS from primary or not.
pub primary_is_running: Option<bool>,
}

/// Feature flag to signal `compute_ctl` to enable certain experimental functionality.
Expand Down
10 changes: 0 additions & 10 deletions pgxn/neon/neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ PG_MODULE_MAGIC;
void _PG_init(void);

static int logical_replication_max_snap_files = 300;
bool primary_is_running = false;

static void
InitLogicalReplicationMonitor(void)
Expand Down Expand Up @@ -289,15 +288,6 @@ _PG_init(void)

pg_init_extension_server();

DefineCustomBoolVariable(
"neon.primary_is_running",
"true if the primary was running at replica startup. false otherwise",
NULL,
&primary_is_running,
false,
PGC_POSTMASTER,
0,
NULL, NULL, NULL);
/*
* Important: This must happen after other parts of the extension are
* loaded, otherwise any settings to GUCs that were set before the
Expand Down
1 change: 0 additions & 1 deletion test_runner/fixtures/neon_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3539,7 +3539,6 @@ def create(
# and make tests more stable.
config_lines = ["max_replication_write_lag=15MB"] + config_lines

config_lines = ["neon.primary_is_running=on"] + config_lines
self.config(config_lines)

return self
Expand Down

1 comment on commit fdadd6a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2998 tests run: 2871 passed, 1 failed, 126 skipped (full report)


Failures on Postgres 14

  • test_pg_regress[None]: debug
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_pg_regress[debug-pg14-None]"
Flaky tests (1)

Postgres 14

  • test_location_conf_churn[3]: debug

Test coverage report is not available

The comment gets automatically updated with the latest test results
fdadd6a at 2024-06-26T13:41:04.737Z :recycle:

Please sign in to comment.