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

Commiteb27d3d

Browse files
Fix assertion failure in snapshot building
Clear any potential stale next_phase_at value from the snapshotbuilder which otherwise may trip an assertion check ensuringthat there is no next_phase_at value.This can be reproduced by running 80 concurrent sessions likethe below where $c is a loop counter (assumes there has been1..$c databases created) : echo " CREATE TABLE replication_example(id SERIAL PRIMARY KEY, somedata int, text varchar(120)); SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot_$c', 'test_decoding'); SELECT data FROM pg_logical_slot_get_changes('regression_slot_$c', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); " | psql -d regress_$c >>psql.log &Backpatch down to v16.Bug: #17695Author: Masahiko Sawada <sawada.mshk@gmail.com>Reviewed-by: Alexander Lakhin <exclusion@gmail.com>Reported-by: bowenshi <zxwsbg@qq.com>Discussion:https://postgr.es/m/17695-6be9277c9295985f@postgresql.orgBackpatch-through: v16
1 parentd431644 commiteb27d3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/replication/logical/snapbuild.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,12 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
19501950
if (TransactionIdPrecedes(ondisk.builder.xmin,builder->initial_xmin_horizon))
19511951
gotosnapshot_not_interesting;
19521952

1953-
/* consistent snapshots have no next phase */
1953+
/*
1954+
* Consistent snapshots have no next phase. Reset next_phase_at as it is
1955+
* possible that an old value may remain.
1956+
*/
19541957
Assert(ondisk.builder.next_phase_at==InvalidTransactionId);
1958+
builder->next_phase_at=InvalidTransactionId;
19551959

19561960
/* ok, we think the snapshot is sensible, copy over everything important */
19571961
builder->xmin=ondisk.builder.xmin;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp