Re: curious postgres (crash) recovery behavior

From: Rébeli-Szabó Tamás <pub(at)rblst(dot)info>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: curious postgres (crash) recovery behavior
Date: 2023-01-04 21:52:27
Message-ID: c32c6f19-86fc-3066-6c5d-de5396c00aff@rblst.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think your log shows a continued archive recovery (PITR), not a crash
recovery.

For a crash recovery (automatic recovery), you would see something like
this in the server log:

LOG:  database system was interrupted; last known up at 2022-12-23
20:50:13 CET
LOG:  database system was not properly shut down; automatic recovery in
progress

In your case, the server started in archive recovery mode (standby mode)
again, restored archived WAL, and recovered the cluster from it.

You must have set the recovery_target_action parameter to 'promote'
(probably via pgbackrest's --target-action parameter), because the
server started in production mode (read-write mode) after a successful
archive recovery.

The server started in standby mode again because the recovery had not
completed, so the standby.signal file had not been deleted from the data
directory.

The server knew that it was an interrupted recovery by looking at the
database cluster state in the control file ("in archive recovery"
instead of "shutdown in recovery").

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2023-01-04 23:54:03 Re: What is the best setup for distributed and fault-tolerant PG database?
Previous Message Zheng Li 2023-01-04 21:35:07 Re: Support logical replication of DDLs