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

Commit75bfe74

Browse files
author
Amit Kapila
committed
Fix stale values in partition map entries on subscribers.
We build the partition map entries on subscribers while applying thechanges for update/delete on partitions. The component relation in eachentry is closed after its use so we need to update it on successive use ofcache entries.This problem was there since the original commitf1ac27b thatintroduced this code but we didn't notice it till the recent commit26b3455 started to use the component relation of partition map cacheentry.Reported-by: Tom Lane, as per buildfarmAuthor: Amit Langote, Hou ZhijieReviewed-by: Amit Kapila, Shi YuBackpatch-through: 13, where it was introducedDiscussion:https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com
1 parent26a6d14 commit75bfe74

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,20 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
596596

597597
entry=&part_entry->relmapentry;
598598

599+
/*
600+
* We must always overwrite entry->localrel with the latest partition
601+
* Relation pointer, because the Relation pointed to by the old value may
602+
* have been cleared after the caller would have closed the partition
603+
* relation after the last use of this entry. Note that localrelvalid is
604+
* only updated by the relcache invalidation callback, so it may still be
605+
* true irrespective of whether the Relation pointed to by localrel has
606+
* been cleared or not.
607+
*/
599608
if (found&&entry->localrelvalid)
609+
{
610+
entry->localrel=partrel;
600611
returnentry;
612+
}
601613

602614
/* Switch to longer-lived context. */
603615
oldctx=MemoryContextSwitchTo(LogicalRepPartMapContext);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp