|
33 | 33 | # PGVERSION=17 make -C tests/upgrade pgaf-current pgaf-next |
34 | 34 | # if needed. |
35 | 35 | # |
36 | | -# Note on Postgres restart: the previous release (v2.1) contains a bug where |
37 | | -# keeper_pg_init_and_register calls keeper_ensure_node_has_been_dropped without |
38 | | -# first calling monitor_init, so the check connects to local Postgres instead of |
39 | | -# the monitor and fails with "schema pgautofailover does not exist". The v2.1 |
40 | | -# supervisor retries 5 times in rapid succession, then exits, which takes the |
41 | | -# container down. The v2.2 binary fixes this (monitor_init is now called |
42 | | -# first). The upgrade procedure therefore restarts each data-node container |
43 | | -# after the old supervisor dies; docker preserves the volume so Postgres data |
44 | | -# is intact, and Postgres itself restarts cleanly from its on-disk state. |
45 | | -# Future upgrades from v2.2 will not need this container restart because the |
46 | | -# v2.2 supervisor correctly re-execs the new binary without triggering the bug. |
| 36 | +# Note on Postgres restart: PREV_TAG auto-detects to the latest released tag |
| 37 | +# that isn't the current in-development version (see tests/upgrade/Makefile), |
| 38 | +# so this spec now exercises v2.2 -> v2.3. v2.1 had a bug where |
| 39 | +# keeper_pg_init_and_register called keeper_ensure_node_has_been_dropped |
| 40 | +# without first calling monitor_init, so the check connected to local |
| 41 | +# Postgres instead of the monitor and failed with "schema pgautofailover |
| 42 | +# does not exist" -- the v2.1 supervisor retried 5 times in rapid succession, |
| 43 | +# then exited, taking the container down, and the upgrade procedure had to |
| 44 | +# restart each data-node container to recover. v2.2 already carries the fix |
| 45 | +# (monitor_init is now called first), so for a v2.2 -> v2.3 upgrade the old |
| 46 | +# supervisor's node-active child re-execs in place and the container never |
| 47 | +# goes down. The "compose start" calls below (test_003b_wait_keeper_restart) |
| 48 | +# are consequently expected to be harmless no-ops against still-running |
| 49 | +# containers, kept so this spec still exercises the restart path correctly |
| 50 | +# whenever PREV_TAG is later pinned back to a pre-v2.2 release. |
47 | 51 |
|
48 | 52 | cluster { |
49 | 53 | monitor |
@@ -80,7 +84,7 @@ step test_001_baseline { |
80 | 84 | FROM pg_available_extensions |
81 | 85 | WHERE name = 'pgautofailover'; |
82 | 86 | } |
83 | | - expect { 2.1 } |
| 87 | + expect { 2.2 } |
84 | 88 | } |
85 | 89 |
|
86 | 90 | # ------------------------------------------------------------------------- |
@@ -112,8 +116,9 @@ step test_002_inject_node_binaries { |
112 | 116 | # overwrites the file on disk -- new backends forked from it still see the |
113 | 117 | # old, pre-restart library image. "ALTER EXTENSION ... UPDATE" validates |
114 | 118 | # every CREATE FUNCTION in the upgrade script by dlsym-ing that in-memory |
115 | | -# library; a function that exists only in the new .so (added by this branch, |
116 | | -# with no v2.1 equivalent) can't resolve there and CREATE FUNCTION fails with |
| 119 | +# library; a function that exists only in the new .so (added after the |
| 120 | +# PREV_TAG release, with no equivalent there) can't resolve there and |
| 121 | +# CREATE FUNCTION fails with |
117 | 122 | # "could not find function ... in file ...". Existing, unchanged functions |
118 | 123 | # don't expose this because their symbols were already present pre-restart. |
119 | 124 | # Restarting first makes the new postmaster load the new .so (already on |
@@ -144,7 +149,7 @@ step test_003_upgrade_monitor { |
144 | 149 | exec monitor pg_autoctl inspect pgsetup wait --pgdata /var/lib/postgres/pgaf --read-write --timeout 30 |
145 | 150 | # Upgrade the extension catalog, now that the restarted postmaster has |
146 | 151 | # the next pgautofailover.so loaded. |
147 | | - exec monitor psql -U docker -d pg_auto_failover -c "ALTER EXTENSION pgautofailover UPDATE TO '2.2'" |
| 152 | + exec monitor psql -U docker -d pg_auto_failover -c "ALTER EXTENSION pgautofailover UPDATE TO '2.3'" |
148 | 153 | } |
149 | 154 |
|
150 | 155 | # ------------------------------------------------------------------------- |
@@ -215,7 +220,7 @@ step test_006_verify_extension_version { |
215 | 220 | FROM pg_available_extensions |
216 | 221 | WHERE name = 'pgautofailover'; |
217 | 222 | } |
218 | | - expect { 2.2 } |
| 223 | + expect { 2.3 } |
219 | 224 | } |
220 | 225 |
|
221 | 226 | # ------------------------------------------------------------------------- |
|
0 commit comments