summaryrefslogtreecommitdiff
path: root/src/include/replication
diff options
context:
space:
mode:
authorPeter Eisentraut2017-05-09 18:40:42 +0000
committerPeter Eisentraut2017-05-09 18:51:49 +0000
commit489b96e80b96c0eda02575347654e87968f2f5f4 (patch)
tree870433737c38221ed5676574780c2cde64342a35 /src/include/replication
parente0bf16060be695ced920727fa29f0d9ede61bd3f (diff)
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>
Diffstat (limited to 'src/include/replication')
-rw-r--r--src/include/replication/worker_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/replication/worker_internal.h b/src/include/replication/worker_internal.h
index f6fee102b2a..26788fec5c1 100644
--- a/src/include/replication/worker_internal.h
+++ b/src/include/replication/worker_internal.h
@@ -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;