pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Rework activation of commit timestamps during recovery 5+ messages / 1 participants [nested] [flat]
* pgsql: Rework activation of commit timestamps during recovery @ 2018-09-26 01:33 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2018-09-26 01:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Rework activation of commit timestamps during recovery The activation and deactivation of commit timestamp tracking has not been handled consistently for a primary or standbys at recovery. The facility can be activated at three different moments of recovery: - The beginning, where a primary would use the GUC value for the decision-making, and where a standby relies on the contents of the control file. - When replaying a XLOG_PARAMETER_CHANGE record at redo. - The end, where both primary and standby rely on the GUC value. Using the GUC value for a primary at the beginning of recovery causes problems with commit timestamp access when doing crash recovery. Particularly, when replaying transaction commits, it could be possible that an attempt to read commit timestamps is done for a transaction which committed at a moment when track_commit_timestamp was disabled. A test case is added to reproduce the failure. The test works down to v11 as it takes advantage of transaction commits within procedures. Reported-by: Hailong Li Author: Masahiko Sawasa, Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.com Backpatch-through: 9.5, where commit timestamps have been introduced. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8d28bf500f6536e295e9c3d7b85cdfec1c4dc913 Modified Files -------------- src/backend/access/transam/commit_ts.c | 9 ++++---- src/backend/access/transam/xlog.c | 9 ++++---- src/test/modules/commit_ts/t/004_restart.pl | 36 +++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Rework activation of commit timestamps during recovery @ 2018-09-26 01:33 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2018-09-26 01:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Rework activation of commit timestamps during recovery The activation and deactivation of commit timestamp tracking has not been handled consistently for a primary or standbys at recovery. The facility can be activated at three different moments of recovery: - The beginning, where a primary would use the GUC value for the decision-making, and where a standby relies on the contents of the control file. - When replaying a XLOG_PARAMETER_CHANGE record at redo. - The end, where both primary and standby rely on the GUC value. Using the GUC value for a primary at the beginning of recovery causes problems with commit timestamp access when doing crash recovery. Particularly, when replaying transaction commits, it could be possible that an attempt to read commit timestamps is done for a transaction which committed at a moment when track_commit_timestamp was disabled. A test case is added to reproduce the failure. The test works down to v11 as it takes advantage of transaction commits within procedures. Reported-by: Hailong Li Author: Masahiko Sawasa, Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.com Backpatch-through: 9.5, where commit timestamps have been introduced. Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/180feb8c7ef5d4968170d49136faf492b6a03c67 Modified Files -------------- src/backend/access/transam/commit_ts.c | 9 ++++---- src/backend/access/transam/xlog.c | 9 ++++---- src/test/modules/commit_ts/t/004_restart.pl | 36 +++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 14 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Rework activation of commit timestamps during recovery @ 2018-09-26 01:33 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2018-09-26 01:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Rework activation of commit timestamps during recovery The activation and deactivation of commit timestamp tracking has not been handled consistently for a primary or standbys at recovery. The facility can be activated at three different moments of recovery: - The beginning, where a primary would use the GUC value for the decision-making, and where a standby relies on the contents of the control file. - When replaying a XLOG_PARAMETER_CHANGE record at redo. - The end, where both primary and standby rely on the GUC value. Using the GUC value for a primary at the beginning of recovery causes problems with commit timestamp access when doing crash recovery. Particularly, when replaying transaction commits, it could be possible that an attempt to read commit timestamps is done for a transaction which committed at a moment when track_commit_timestamp was disabled. A test case is added to reproduce the failure. The test works down to v11 as it takes advantage of transaction commits within procedures. Reported-by: Hailong Li Author: Masahiko Sawasa, Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.com Backpatch-through: 9.5, where commit timestamps have been introduced. Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cb822ffb798019b3cfb779f73725925d0416f6c8 Modified Files -------------- src/backend/access/transam/commit_ts.c | 9 ++++----- src/backend/access/transam/xlog.c | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Rework activation of commit timestamps during recovery @ 2018-09-26 01:33 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2018-09-26 01:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Rework activation of commit timestamps during recovery The activation and deactivation of commit timestamp tracking has not been handled consistently for a primary or standbys at recovery. The facility can be activated at three different moments of recovery: - The beginning, where a primary would use the GUC value for the decision-making, and where a standby relies on the contents of the control file. - When replaying a XLOG_PARAMETER_CHANGE record at redo. - The end, where both primary and standby rely on the GUC value. Using the GUC value for a primary at the beginning of recovery causes problems with commit timestamp access when doing crash recovery. Particularly, when replaying transaction commits, it could be possible that an attempt to read commit timestamps is done for a transaction which committed at a moment when track_commit_timestamp was disabled. A test case is added to reproduce the failure. The test works down to v11 as it takes advantage of transaction commits within procedures. Reported-by: Hailong Li Author: Masahiko Sawasa, Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.com Backpatch-through: 9.5, where commit timestamps have been introduced. Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e513a3d854a13c141e7d73e209ad44d789352479 Modified Files -------------- src/backend/access/transam/commit_ts.c | 9 ++++----- src/backend/access/transam/xlog.c | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Rework activation of commit timestamps during recovery @ 2018-09-26 01:33 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 5+ messages in thread From: Michael Paquier @ 2018-09-26 01:33 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Rework activation of commit timestamps during recovery The activation and deactivation of commit timestamp tracking has not been handled consistently for a primary or standbys at recovery. The facility can be activated at three different moments of recovery: - The beginning, where a primary would use the GUC value for the decision-making, and where a standby relies on the contents of the control file. - When replaying a XLOG_PARAMETER_CHANGE record at redo. - The end, where both primary and standby rely on the GUC value. Using the GUC value for a primary at the beginning of recovery causes problems with commit timestamp access when doing crash recovery. Particularly, when replaying transaction commits, it could be possible that an attempt to read commit timestamps is done for a transaction which committed at a moment when track_commit_timestamp was disabled. A test case is added to reproduce the failure. The test works down to v11 as it takes advantage of transaction commits within procedures. Reported-by: Hailong Li Author: Masahiko Sawasa, Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/11224478-a782-203b-1f17-e4797b39bdf0@qunar.com Backpatch-through: 9.5, where commit timestamps have been introduced. Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/69a5686368c9c5609fdb274714b39f7ded1b0b46 Modified Files -------------- src/backend/access/transam/commit_ts.c | 9 ++++----- src/backend/access/transam/xlog.c | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2018-09-26 01:33 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-09-26 01:33 pgsql: Rework activation of commit timestamps during recovery Michael Paquier <michael@paquier.xyz> 2018-09-26 01:33 pgsql: Rework activation of commit timestamps during recovery Michael Paquier <michael@paquier.xyz> 2018-09-26 01:33 pgsql: Rework activation of commit timestamps during recovery Michael Paquier <michael@paquier.xyz> 2018-09-26 01:33 pgsql: Rework activation of commit timestamps during recovery Michael Paquier <michael@paquier.xyz> 2018-09-26 01:33 pgsql: Rework activation of commit timestamps during recovery Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox