1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Keep CommitTs module in sync in standby and master

We allow this module to be turned off on restarts, so a restart time
check is enough to activate or deactivate the module; however, if there
is a standby replaying WAL emitted from a master which is restarted, but
the standby isn't, the state in the standby becomes inconsistent and can
easily be crashed.

Fix by activating and deactivating the module during WAL replay on
parameter change as well as on system start.

Problem reported by Fujii Masao in
http://www.postgresql.org/message-id/CAHGQGwFhJ3CnHo1CELEfay18yg_RA-XZT-7D8NuWUoYSZ90r4Q@mail.gmail.com

Author: Petr Jelínek
This commit is contained in:
Alvaro Herrera
2015-03-09 17:44:00 -03:00
parent e3f1c24b99
commit 4f3924d9cd
4 changed files with 99 additions and 24 deletions

View File

@ -1087,7 +1087,7 @@ vac_truncate_clog(TransactionId frozenXID,
* checkpoint.
*/
TruncateCLOG(frozenXID);
TruncateCommitTs(frozenXID);
TruncateCommitTs(frozenXID, true);
/*
* Update the wrap limit for GetNewTransactionId and creation of new