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

Commit357cb8f

Browse files
author
Amit Kapila
committed
Fix valgrind issue in pgoutput.c.
We use a tuple conversion map for partitions when replicating using anancestor's schema to convert tuples from partition's type to theancestor's. Before this map got initialized, we were processinginvalidation messages which access this map.This issue happens only in version 13 as in HEAD we already have a codethat initializes each relation entry before we can process anyinvalidation message. This issue is introduced by commitd250568 inversion 13.Reported-by: Tom Lane, as per buildfarm meber skinkAuthor: Amit LangoteReviewed-by: Dilip Kumar, Amit KapilaDiscussion:https://www.postgresql.org/message-id/648020.1623854904@sss.pgh.pa.us
1 parent42f782b commit357cb8f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

‎src/backend/replication/pgoutput/pgoutput.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,20 @@ get_rel_sync_entry(PGOutputData *data, Oid relid)
685685
Assert(entry!=NULL);
686686

687687
/* Not found means schema wasn't sent */
688-
if (!found|| !entry->replicate_valid)
688+
if (!found)
689+
{
690+
/*
691+
* immediately make a new entry valid enough to satisfy callbacks
692+
*/
693+
entry->schema_sent= false;
694+
entry->replicate_valid= false;
695+
entry->pubactions.pubinsert=entry->pubactions.pubupdate=
696+
entry->pubactions.pubdelete=entry->pubactions.pubtruncate= false;
697+
entry->publish_as_relid=InvalidOid;
698+
entry->map=NULL;/* will be set by maybe_send_schema() if needed */
699+
}
700+
701+
if (!entry->replicate_valid)
689702
{
690703
List*pubids=GetRelationPublications(relid);
691704
ListCell*lc;
@@ -782,13 +795,9 @@ get_rel_sync_entry(PGOutputData *data, Oid relid)
782795
list_free(pubids);
783796

784797
entry->publish_as_relid=publish_as_relid;
785-
entry->map=NULL;/* will be set by maybe_send_schema() if needed */
786798
entry->replicate_valid= true;
787799
}
788800

789-
if (!found)
790-
entry->schema_sent= false;
791-
792801
returnentry;
793802
}
794803

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp