Wait for final PostgreSQL database before isolated restore
Assistant: codex Assistant-Model: gpt-6.1-sol Assistant-Session: 01a18e2d-f513-7742-b8e7-12af0b744ff3
This commit is contained in:
parent
360b6bdd69
commit
5f973fa9a7
2 changed files with 45 additions and 1 deletions
39
docs/release/postgres-restore-readiness-2026-10-31.json
Normal file
39
docs/release/postgres-restore-readiness-2026-10-31.json
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"schema": "coulomb.postgres-startup-readiness-observation.v1",
|
||||
"image": "sha256:ff23cdce56cac62ada6f66013e1a50864c0abbe79d132d40b6e05bd80f378a70",
|
||||
"observations": [
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": true,
|
||||
"target_database_tcp_ready": false
|
||||
},
|
||||
{
|
||||
"unix_socket_ready": false,
|
||||
"target_database_tcp_ready": true
|
||||
}
|
||||
],
|
||||
"early_unix_ready_observed": true,
|
||||
"final_target_database_tcp_ready": true,
|
||||
"network": "none",
|
||||
"published_ports": 0,
|
||||
"production_data_used": false
|
||||
}
|
||||
|
|
@ -116,7 +116,12 @@ def main() -> int:
|
|||
'-e', 'POSTGRES_DB=coulomb_social_restore', image])
|
||||
created = True
|
||||
for _ in range(45):
|
||||
p = subprocess.run(['docker', 'exec', name, 'pg_isready', '-U', 'postgres'],
|
||||
# The image's temporary initialization server accepts Unix-socket
|
||||
# connections before creating the target DB and restarting. Require
|
||||
# a query against the final TCP server before starting pg_restore.
|
||||
p = subprocess.run(['docker', 'exec', name, 'psql', '-h', '127.0.0.1',
|
||||
'-U', 'postgres', '-d', 'coulomb_social_restore',
|
||||
'-tAc', 'SELECT 1'],
|
||||
capture_output=True)
|
||||
if p.returncode == 0:
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue