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

Commit3a6ef0c

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 parent9adc4cd commit3a6ef0c

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
@@ -145,7 +145,7 @@ logicalrep_relmap_free_entry(LogicalRepRelMapEntry *entry)
145145
bms_free(remoterel->attkeys);
146146

147147
if (entry->attrmap)
148-
pfree(entry->attrmap);
148+
free_attrmap(entry->attrmap);
149149
}
150150

151151
/*
@@ -337,6 +337,13 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
337337
MemoryContextoldctx;
338338
inti;
339339

340+
/* Release the no-longer-useful attrmap, if any. */
341+
if (entry->attrmap)
342+
{
343+
free_attrmap(entry->attrmap);
344+
entry->attrmap=NULL;
345+
}
346+
340347
/* Try to find and lock the relation by name. */
341348
relid=RangeVarGetRelid(makeRangeVar(remoterel->nspname,
342349
remoterel->relname,-1),
@@ -588,6 +595,13 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
588595
part_entry->partoid=partOid;
589596
}
590597

598+
/* Release the no-longer-useful attrmap, if any. */
599+
if (entry->attrmap)
600+
{
601+
free_attrmap(entry->attrmap);
602+
entry->attrmap=NULL;
603+
}
604+
591605
if (!entry->remoterel.remoteid)
592606
{
593607
inti;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp