CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.96k stars 594 forks source link

Im not able restore db from backup #4022

Closed 9techijcore closed 3 weeks ago

9techijcore commented 3 weeks ago

Hello

Im not able restore db from backup. When I create postgrescluster automatically pod for backup was started. Pod was successfully done. But when i edit restore section for correct time and use annotation for start restore pod for restore db was failed due to this error,

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? 2024-10-29 15:27:33.892 GMT [258] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit 2024-10-29 15:27:33.893 GMT [258] LOG: listening on IPv6 address "::1", port 5432 2024-10-29 15:27:33.893 GMT [258] LOG: listening on IPv4 address "127.0.0.1", port 5432 2024-10-29 15:27:33.905 GMT [258] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-10-29 15:27:33.926 GMT [261] LOG: database system was interrupted while in recovery at log time 2024-10-29 15:15:17 GMT 2024-10-29 15:27:33.926 GMT [261] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target. 2024-10-29 15:27:34.012 GMT [261] LOG: starting point-in-time recovery to 2024-10-29 16:25:00+00 2024-10-29 15:27:34.323 GMT [261] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:34.504 GMT [261] LOG: restored log file "000000010000000000000003" from archive 2024-10-29 15:27:34.577 GMT [261] LOG: redo starts at 0/3000028 2024-10-29 15:27:34.691 GMT [261] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:34.773 GMT [261] LOG: restored log file "000000010000000000000005" from archive 2024-10-29 15:27:34.871 GMT [261] LOG: restored log file "000000010000000000000006" from archive 2024-10-29 15:27:35.043 GMT [261] LOG: consistent recovery state reached at 0/5000050 2024-10-29 15:27:35.043 GMT [258] LOG: database system is ready to accept read-only connections 2024-10-29 15:27:35.155 GMT [261] LOG: redo done at 0/6000148 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.57 s 2024-10-29 15:27:35.156 GMT [261] FATAL: recovery ended before configured recovery target was reached 2024-10-29 15:27:35.157 GMT [258] LOG: startup process (PID 261) exited with exit code 1 2024-10-29 15:27:35.157 GMT [258] LOG: terminating any other active server processes 2024-10-29 15:27:35.157 GMT [258] LOG: shutting down due to startup process failure 2024-10-29 15:27:35.159 GMT [258] LOG: database system is shut down psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? 2024-10-29 15:27:36.149 GMT [298] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit 2024-10-29 15:27:36.149 GMT [298] LOG: listening on IPv6 address "::1", port 5432 2024-10-29 15:27:36.149 GMT [298] LOG: listening on IPv4 address "127.0.0.1", port 5432 2024-10-29 15:27:36.153 GMT [298] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-10-29 15:27:36.160 GMT [301] LOG: database system was interrupted while in recovery at log time 2024-10-29 15:15:17 GMT 2024-10-29 15:27:36.160 GMT [301] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target. 2024-10-29 15:27:36.205 GMT [301] LOG: starting point-in-time recovery to 2024-10-29 16:25:00+00 2024-10-29 15:27:36.519 GMT [301] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:36.723 GMT [301] LOG: restored log file "000000010000000000000003" from archive 2024-10-29 15:27:36.799 GMT [301] LOG: redo starts at 0/3000028 2024-10-29 15:27:36.912 GMT [301] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:36.988 GMT [301] LOG: restored log file "000000010000000000000005" from archive 2024-10-29 15:27:37.055 GMT [301] LOG: restored log file "000000010000000000000006" from archive 2024-10-29 15:27:37.228 GMT [301] LOG: consistent recovery state reached at 0/5000050 2024-10-29 15:27:37.228 GMT [298] LOG: database system is ready to accept read-only connections 2024-10-29 15:27:37.340 GMT [301] LOG: redo done at 0/6000148 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.54 s 2024-10-29 15:27:37.340 GMT [301] FATAL: recovery ended before configured recovery target was reached 2024-10-29 15:27:37.341 GMT [298] LOG: startup process (PID 301) exited with exit code 1 2024-10-29 15:27:37.341 GMT [298] LOG: terminating any other active server processes 2024-10-29 15:27:37.341 GMT [298] LOG: shutting down due to startup process failure 2024-10-29 15:27:37.344 GMT [298] LOG: database system is shut down psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? 2024-10-29 15:27:38.414 GMT [338] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit 2024-10-29 15:27:38.415 GMT [338] LOG: listening on IPv6 address "::1", port 5432 2024-10-29 15:27:38.415 GMT [338] LOG: listening on IPv4 address "127.0.0.1", port 5432 2024-10-29 15:27:38.418 GMT [338] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-10-29 15:27:38.426 GMT [341] LOG: database system was interrupted while in recovery at log time 2024-10-29 15:15:17 GMT 2024-10-29 15:27:38.426 GMT [341] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target. 2024-10-29 15:27:38.467 GMT [341] LOG: starting point-in-time recovery to 2024-10-29 16:25:00+00 2024-10-29 15:27:38.578 GMT [341] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:39.266 GMT [341] LOG: restored log file "000000010000000000000003" from archive 2024-10-29 15:27:39.326 GMT [341] LOG: redo starts at 0/3000028 2024-10-29 15:27:39.338 GMT [341] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:39.403 GMT [341] LOG: restored log file "000000010000000000000005" from archive 2024-10-29 15:27:39.487 GMT [341] LOG: restored log file "000000010000000000000006" from archive 2024-10-29 15:27:39.675 GMT [341] LOG: consistent recovery state reached at 0/5000050 2024-10-29 15:27:39.675 GMT [338] LOG: database system is ready to accept read-only connections 2024-10-29 15:27:39.789 GMT [341] LOG: redo done at 0/6000148 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.46 s 2024-10-29 15:27:39.789 GMT [341] FATAL: recovery ended before configured recovery target was reached 2024-10-29 15:27:39.790 GMT [338] LOG: startup process (PID 341) exited with exit code 1 2024-10-29 15:27:39.790 GMT [338] LOG: terminating any other active server processes 2024-10-29 15:27:39.791 GMT [338] LOG: shutting down due to startup process failure 2024-10-29 15:27:39.793 GMT [338] LOG: database system is shut down psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? 2024-10-29 15:27:40.789 GMT [378] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit 2024-10-29 15:27:40.790 GMT [378] LOG: listening on IPv6 address "::1", port 5432 2024-10-29 15:27:40.790 GMT [378] LOG: listening on IPv4 address "127.0.0.1", port 5432 2024-10-29 15:27:40.793 GMT [378] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-10-29 15:27:40.802 GMT [381] LOG: database system was interrupted while in recovery at log time 2024-10-29 15:15:17 GMT 2024-10-29 15:27:40.802 GMT [381] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target. 2024-10-29 15:27:40.870 GMT [381] LOG: starting point-in-time recovery to 2024-10-29 16:25:00+00 2024-10-29 15:27:40.983 GMT [381] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:41.670 GMT [381] LOG: restored log file "000000010000000000000003" from archive 2024-10-29 15:27:41.733 GMT [381] LOG: redo starts at 0/3000028 2024-10-29 15:27:41.747 GMT [381] LOG: restored log file "000000010000000000000004" from archive 2024-10-29 15:27:41.823 GMT [381] LOG: restored log file "000000010000000000000005" from archive 2024-10-29 15:27:41.897 GMT [381] LOG: restored log file "000000010000000000000006" from archive 2024-10-29 15:27:42.072 GMT [381] LOG: consistent recovery state reached at 0/5000050 2024-10-29 15:27:42.072 GMT [378] LOG: database system is ready to accept read-only connections 2024-10-29 15:27:42.185 GMT [381] LOG: redo done at 0/6000148 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.45 s 2024-10-29 15:27:42.185 GMT [381] FATAL: recovery ended before configured recovery target was reached 2024-10-29 15:27:42.186 GMT [378] LOG: startup process (PID 381) exited with exit code 1 2024-10-29 15:27:42.186 GMT [378] LOG: terminating any other active server processes 2024-10-29 15:27:42.187 GMT [378] LOG: shutting down due to startup process failure 2024-10-29 15:27:42.189 GMT [378] LOG: database system is shut down psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? 2024-10-29 15:27:43.266 GMT [418] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit 2024-10-29 15:27:43.267 GMT [418] LOG: listening on IPv6 address "::1", port 5432 2024-10-29 15:27:43.267 GMT [418] LOG: listening on IPv4 address "127.0.0.1", port 5432 2024-10-29 15:27:43.271 GMT [418] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2024-10-29 15:27:43.281 GMT [421] LOG: database system was interrupted while in recovery at log time 2024-10-29 15:15:17 GMT 2024-10-29 15:27:43.281 GMT [421] HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.

I tried older pgo version like 5.5.0 or 5.6.0 but still same im not able influence behavior Only what i can is change type from time on immediate and works properly.

Environment