diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index 8fb28f491db..52489a2e90d 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -183,8 +183,9 @@ should_refetch_tuple(TM_Result res, TM_FailureData *tmfd) * 'skipduplicates' specifies whether the first matching tuple can be used * without comparing it against 'searchslot', or at worst by comparing just * the index key columns (when the index scan requires a recheck, as with a - * lossy GiST index for WITHOUT OVERLAPS). If false, all matching tuples are - * compared against 'searchslot', which must contain a complete row. + * lossy GiST index for WITHOUT OVERLAPS) using the index's own equality + * semantics. If false, all matching tuples are compared against 'searchslot', + * which must contain a complete row. */ bool RelationFindReplTupleByIndex(Relation rel, Oid idxoid, @@ -225,10 +226,7 @@ retry: /* * Avoid expensive equality check if the index is primary key or * replica identity index, unless the index scan indicates that a - * recheck is needed: a lossy index (e.g. a GiST index on a multirange - * column of a WITHOUT OVERLAPS key) cannot prove an exact match, so - * compare the key columns using the index's own equality semantics - * (see repl_index_key_equal). + * recheck is needed. */ if (!skipduplicates) { @@ -757,10 +755,7 @@ RelationFindDeletedTupleInfoByIndex(Relation rel, Oid idxoid, /* * Avoid expensive equality check if the index is a primary key or * replica identity index, unless the index scan indicates that a - * recheck is needed: a lossy index (e.g. a GiST index on a multirange - * column of a WITHOUT OVERLAPS key) cannot prove an exact match, so - * compare the key columns using the index's own equality semantics - * (see repl_index_key_equal). + * recheck is needed. */ if (!skipduplicates) { diff --git a/src/test/subscription/t/034_temporal.pl b/src/test/subscription/t/034_temporal.pl index f8e662ef367..37b452e9297 100644 --- a/src/test/subscription/t/034_temporal.pl +++ b/src/test/subscription/t/034_temporal.pl @@ -635,7 +635,7 @@ drop_everything(); # A temporal key over a multirange column is backed by a lossy GiST index: two # distinct multiranges that share a bounding range are indistinguishable in the # index, so an index probe can return candidate tuples that are not exact -# matches. The apply worker must recheck each candidate against the actual row +# matches. The apply worker must recheck each candidate against the actual row # values, otherwise it could apply the change to the wrong row. # ################################# diff --git a/src/test/subscription/t/035_conflicts.pl b/src/test/subscription/t/035_conflicts.pl index 03380ce2467..b2a7b29c116 100644 --- a/src/test/subscription/t/035_conflicts.pl +++ b/src/test/subscription/t/035_conflicts.pl @@ -447,9 +447,9 @@ $node_B->safe_psql('postgres', "DROP TABLE tab_defer"); # # The publisher updates a row that never existed on the subscriber, while the # subscriber locally deleted a different row whose multirange key shares the -# same bounding range. Without a recheck, the dead "decoy" row would be -# accepted as the update target and the conflict would be misreported as -# update_deleted instead of update_missing. +# same bounding range. Without a recheck, the deleted row would be accepted +# as the update target and the conflict would be misreported as update_deleted +# instead of update_missing. ############################################################################### # Publisher table holding the row that will be updated. @@ -461,7 +461,7 @@ $node_B->safe_psql( ALTER PUBLICATION tap_pub_B ADD TABLE tab_mr; "); -# Subscriber table with the lossy replica identity index. The index is +# Subscriber table with the lossy replica identity index. The index is # created before the conflict detection slot's xmin is pinned below, so that # it can be used to find deleted tuples. $node_A->safe_psql('postgres', @@ -475,8 +475,8 @@ $node_A->wait_for_subscription_sync($node_B, $subname_AB); # Pin the conflict detection slot's xmin: hold an open transaction with an # assigned transaction ID so that oldest_nonremovable_xid cannot advance past -# it. This keeps the decoy row deleted below retained and recently dead, -# making the test independent of timing. +# it. This keeps the row deleted below retained and recently dead, making the +# test independent of timing. my $holder = $node_A->background_psql('postgres'); $holder->query_safe('BEGIN'); my $pinned_xid = $holder->query_safe('SELECT txid_current()'); @@ -487,7 +487,7 @@ ok( $node_A->poll_query_until( ), "conflict detection slot xmin pinned at $pinned_xid"); -# Insert and locally delete the decoy row: a different multirange with the +# Insert and locally delete the row: a different multirange with the # same bounding range as the publisher's key. $node_A->safe_psql( 'postgres', " @@ -513,7 +513,7 @@ like( 'update target reported as missing'); ok( $logfile !~ /conflict detected on relation "public.tab_mr": conflict=update_deleted/, - 'decoy row sharing the bounding range is not reported as update_deleted'); + 'deleted row sharing the bounding range is not reported as update_deleted'); # Clean up $holder->query_safe('COMMIT');