8000 Disable commit timestamps during bootstrap · postgres/postgres@8bca447 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bca447

Browse files
committed
Disable commit timestamps during bootstrap
Attempting to use commit timestamps during bootstrapping leads to an assertion failure, that can be reached for example with an initdb -c that enables track_commit_timestamp. It makes little sense to register a commit timestamp for a BootstrapTransactionId, so let's disable the activation of the module in this case. This problem has been independently reported once by each author of this commit. Each author has proposed basically the same patch, relying on IsBootstrapProcessingMode() to skip the use of commit_ts during bootstrap. The test addition is a suggestion by me, and is applied down to v16. Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Author: Andy Fan <zhihuifan1213@163.com> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/OSCPR01MB14966FF9E4C4145F37B937E52F5102@OSCPR01MB14966.jpnprd01.prod.outlook.com Discussion: https://postgr.es/m/87plejmnpy.fsf@163.com Backpatch-through: 13
1 parent f9ba071 commit 8bca447

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/access/transam/commit_ts.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,13 @@ ActivateCommitTs(void)
637637
TransactionId xid;
638638
int pageno;
639639

640+
/*
641+
* During bootstrap, we should not register commit timestamps so skip the
642+
* activation in this case.
643+
*/
644+
if (IsBootstrapProcessingMode())
645+
return;
646+
640647
/* If we've done this already, there's nothing to do */
641648
LWLockAcquire(CommitTsLock, LW_EXCLUSIVE);
642649
if (commitTsShared->commitTsActive)

0 commit comments

Comments
 (0)
0