Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1ecd0d6

Browse files
knizhnikkelvich
authored andcommitted
Update top memory context
1 parent ab441db commit 1ecd0d6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pglogical_apply.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ static void process_remote_insert(StringInfo s, Relation rel);
7979
static void process_remote_update(StringInfo s, Relation rel);
8080
static void process_remote_delete(StringInfo s, Relation rel);
8181

82-
static MemoryContext TopContext;
8382
static bool GucAltered; /* transaction is setting some GUC variables */
8483

8584
/*
@@ -662,7 +661,7 @@ process_remote_commit(StringInfo in)
662661
case PGLOGICAL_PREPARE:
663662
{
664663
Assert(IsTransactionState() && TransactionIdIsValid(MtmGetCurrentTransactionId()));
665-
gid = pstrdup(pq_getmsgstring(in)); /* in case of spilling large transaction to the file, message body will be deallocated, so copy it */
664+
gid = pq_getmsgstring(in);
666665
if (MtmExchangeGlobalTransactionStatus(gid, TRANSACTION_STATUS_IN_PROGRESS) == TRANSACTION_STATUS_ABORTED) {
667666
MTM_LOG1("Avoid prepare of previously aborted global transaction %s", gid);
668667
AbortCurrentTransaction();
@@ -1047,7 +1046,7 @@ void MtmExecutor(void* work, size_t size)
10471046
ALLOCSET_DEFAULT_INITSIZE,
10481047
ALLOCSET_DEFAULT_MAXSIZE);
10491048
}
1050-
TopContext = MemoryContextSwitchTo(MtmApplyContext);
1049+
TopMemoryContext = MemoryContextSwitchTo(MtmApplyContext);
10511050
replorigin_session_origin = InvalidRepOriginId;
10521051
PG_TRY();
10531052
{

0 commit comments

Comments
 (0)