Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a6c39b

Browse files
committed
Disable commit timestamps during bootstrap
Attempting to use commit timestamps during bootstrapping leads to anassertion failure, that can be reached for example with an initdb -cthat enables track_commit_timestamp. It makes little sense to registera commit timestamp for a BootstrapTransactionId, so let's disable theactivation of the module in this case.This problem has been independently reported once by each author of thiscommit. Each author has proposed basically the same patch, relying onIsBootstrapProcessingMode() to skip the use of commit_ts duringbootstrap. The test addition is a suggestion by me, and is applied downto 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.comDiscussion:https://postgr.es/m/87plejmnpy.fsf@163.comBackpatch-through: 13
1 parent78ebda6 commit5a6c39b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎src/backend/access/transam/commit_ts.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,13 @@ ActivateCommitTs(void)
707707
TransactionIdxid;
708708
int64pageno;
709709

710+
/*
711+
* During bootstrap, we should not register commit timestamps so skip the
712+
* activation in this case.
713+
*/
714+
if (IsBootstrapProcessingMode())
715+
return;
716+
710717
/* If we've done this already, there's nothing to do */
711718
LWLockAcquire(CommitTsLock,LW_EXCLUSIVE);
712719
if (commitTsShared->commitTsActive)

‎src/test/modules/commit_ts/t/001_base.pl‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use PostgreSQL::Test::Cluster;
1212

1313
my$node = PostgreSQL::Test::Cluster->new('foxtrot');
14-
$node->init;
15-
$node->append_conf('postgresql.conf','track_commit_timestamp = on');
14+
$node->init(extra=> ['-c',"track_commit_timestamp=on" ]);
1615
$node->start;
1716

1817
# Create a table, compare "now()" to the commit TS of its xmin

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp