1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Improve memory use in logical replication apply

Previously, the memory used by the logical replication apply worker for
processing messages would never be freed, so that could end up using a
lot of memory.  To improve that, change the existing ApplyContext memory
context to ApplyMessageContext and reset that after every
message (similar to MessageContext used elsewhere).  For consistency of
naming, rename the ApplyCacheContext to ApplyContext.

Author: Stas Kelvich <s.kelvich@postgrespro.ru>
This commit is contained in:
Peter Eisentraut
2017-05-09 14:40:42 -04:00
parent e0bf16060b
commit 489b96e80b
3 changed files with 40 additions and 26 deletions

View File

@ -56,8 +56,8 @@ typedef struct LogicalRepWorker
TimestampTz reply_time;
} LogicalRepWorker;
/* Memory context for cached variables in apply worker. */
extern MemoryContext ApplyCacheContext;
/* Main memory context for apply worker. Permanent during worker lifetime. */
extern MemoryContext ApplyContext;
/* libpqreceiver connection */
extern struct WalReceiverConn *wrconn;