From e3945d94fd8d26a645c6387dfbe820ac27b6df20 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 6 Oct 2021 10:58:15 +0300 Subject: [PATCH] Store unlogged tables locally, and replace PD_WAL_LOGGED. All the changes are in the vendor/postgres side. However, because we now generate fewer Full Page Writes, the 'branch_behind' test needs to be modified so that it still generates enough WAL to consume a few WAL segments. --- test_runner/batch_others/test_branch_behind.py | 14 +++++++------- vendor/postgres | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test_runner/batch_others/test_branch_behind.py b/test_runner/batch_others/test_branch_behind.py index 19e5384bba..9189017050 100644 --- a/test_runner/batch_others/test_branch_behind.py +++ b/test_runner/batch_others/test_branch_behind.py @@ -33,11 +33,11 @@ def test_branch_behind(zenith_cli, pageserver: ZenithPageserver, postgres: Postg main_cur.execute(''' INSERT INTO foo SELECT 'long string to consume some space' || g - FROM generate_series(1, 100000) g + FROM generate_series(1, 200000) g ''') main_cur.execute('SELECT pg_current_wal_insert_lsn()') lsn_b = main_cur.fetchone()[0] - print('LSN after 100100 rows: ' + lsn_b) + print('LSN after 200100 rows: ' + lsn_b) # Branch at the point where only 100 rows were inserted zenith_cli.run(["branch", "test_branch_behind_hundred", "test_branch_behind@" + lsn_a]) @@ -46,15 +46,15 @@ def test_branch_behind(zenith_cli, pageserver: ZenithPageserver, postgres: Postg main_cur.execute(''' INSERT INTO foo SELECT 'long string to consume some space' || g - FROM generate_series(1, 100000) g + FROM generate_series(1, 200000) g ''') main_cur.execute('SELECT pg_current_wal_insert_lsn()') main_cur.execute('SELECT pg_current_wal_insert_lsn()') lsn_c = main_cur.fetchone()[0] - print('LSN after 200100 rows: ' + lsn_c) + print('LSN after 400100 rows: ' + lsn_c) - # Branch at the point where only 200 rows were inserted + # Branch at the point where only 200100 rows were inserted zenith_cli.run(["branch", "test_branch_behind_more", "test_branch_behind@" + lsn_b]) pg_hundred = postgres.create_start("test_branch_behind_hundred") @@ -70,11 +70,11 @@ def test_branch_behind(zenith_cli, pageserver: ZenithPageserver, postgres: Postg more_pg_conn = pg_more.connect() more_cur = more_pg_conn.cursor() more_cur.execute('SELECT count(*) FROM foo') - assert more_cur.fetchone() == (100100, ) + assert more_cur.fetchone() == (200100, ) # All the rows are visible on the main branch main_cur.execute('SELECT count(*) FROM foo') - assert main_cur.fetchone() == (200100, ) + assert main_cur.fetchone() == (400100, ) # Check bad lsn's for branching diff --git a/vendor/postgres b/vendor/postgres index 56c561aa77..5387eb4a3b 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit 56c561aa770b01d9e5cfcbf064eebe33349b7f77 +Subproject commit 5387eb4a3b892d3ff18a3a93f4bd996d43ea3b33