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

Commitac0e2d3

Browse files
author
Amit Kapila
committed
Fix memory leak due to LogicalRepRelMapEntry.attrmap.
When rebuilding the relation mapping on subscribers, we were not releasingthe attribute mapping's memory which was no longer required.The attribute mapping used in logical tuple conversion was refactored inPG13 (by commite1551f9) but we forgot to update the related code thatfrees the attribute map.Author: Hou ZhijieReviewed-by: Amit Langote, Amit Kapila, Shi yuBackpatch-through: 10, where it was introducedDiscussion:https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com
1 parentca7a0d1 commitac0e2d3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ logicalrep_relmap_free_entry(LogicalRepRelMapEntry *entry)
144144
bms_free(remoterel->attkeys);
145145

146146
if (entry->attrmap)
147-
pfree(entry->attrmap);
147+
free_attrmap(entry->attrmap);
148148
}
149149

150150
/*
@@ -373,6 +373,13 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
373373
inti;
374374
Bitmapset*missingatts;
375375

376+
/* Release the no-longer-useful attrmap, if any. */
377+
if (entry->attrmap)
378+
{
379+
free_attrmap(entry->attrmap);
380+
entry->attrmap=NULL;
381+
}
382+
376383
/* Try to find and lock the relation by name. */
377384
relid=RangeVarGetRelid(makeRangeVar(remoterel->nspname,
378385
remoterel->relname,-1),
@@ -620,6 +627,13 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
620627
part_entry->partoid=partOid;
621628
}
622629

630+
/* Release the no-longer-useful attrmap, if any. */
631+
if (entry->attrmap)
632+
{
633+
free_attrmap(entry->attrmap);
634+
entry->attrmap=NULL;
635+
}
636+
623637
if (!entry->remoterel.remoteid)
624638
{
625639
inti;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp