mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-22 15:41:15 +00:00
Change behavior of ComputeControlPlane::new_node() (#235)
Previously, transaction commit could happen regardless of whether
pageserver has caught up or not. This patch aims to fix that.
There are two notable changes:
1. ComputeControlPlane::new_node() now sets the
`synchronous_standby_names = 'pageserver'` parameter to delay
transaction commit until pageserver acting as a standby has
fetched and ack'd a relevant portion of WAL.
2. pageserver now has to:
- Specify the `application_name = pageserver` which matches the
one in `synchronous_standby_names`.
- Properly reply with the ack'd LSNs.
This means that some tests don't need sleeps anymore.
TODO: We should probably make this behavior configurable.
Fixes #187.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import psycopg2
|
||||
import time
|
||||
|
||||
pytest_plugins = ("fixtures.zenith_fixtures")
|
||||
|
||||
@@ -38,13 +37,6 @@ def test_restart_compute(zenith_cli, pageserver, postgres, pg_bin):
|
||||
cur.execute('SELECT count(*) FROM foo')
|
||||
assert cur.fetchone() == (2, )
|
||||
|
||||
# FIXME: Currently, there is no guarantee that by the time the INSERT commits, the WAL
|
||||
# has been streamed safely to the WAL safekeeper or page server. It is merely stored
|
||||
# on the Postgres instance's local disk. Sleep a little, to give it time to be
|
||||
# streamed. This should be removed, when we have the ability to run the Postgres
|
||||
# instance -> safekeeper streaming in synchronous mode.
|
||||
time.sleep(5)
|
||||
|
||||
# Stop, and destroy the Postgres instance. Then recreate and restart it.
|
||||
pg_conn.close()
|
||||
pg.stop_and_destroy()
|
||||
|
||||
Reference in New Issue
Block a user