v1-0001-Cleanup-toast-hash.patch
text/x-patch
Filename: v1-0001-Cleanup-toast-hash.patch
Type: text/x-patch
Part: 0
Patch
Format: format-patch
Series: patch v1-0001
Subject: Cleanup toast hash
| File | + | − |
|---|---|---|
| src/backend/replication/logical/reorderbuffer.c | 8 | 0 |
From ff049e1ab141ba6bc5c05d62e7a225abfb18fad8 Mon Sep 17 00:00:00 2001
From: Dilip Kumar <dilipkumar@localhost.localdomain>
Date: Thu, 27 May 2021 10:03:27 +0530
Subject: [PATCH v1] Cleanup toast hash
---
src/backend/replication/logical/reorderbuffer.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 4401608..39242f2 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -437,6 +437,10 @@ ReorderBufferReturnTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
txn->tuplecid_hash = NULL;
}
+ /* cleanup the toast hash if it is not done already. */
+ if (txn->toast_hash != NULL)
+ ReorderBufferToastReset(rb, txn);
+
if (txn->invalidations)
{
pfree(txn->invalidations);
@@ -1629,6 +1633,10 @@ ReorderBufferTruncateTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, bool txn_prep
txn->tuplecid_hash = NULL;
}
+ /* cleanup the toast hash if it is not done already. */
+ if (txn->toast_hash != NULL)
+ ReorderBufferToastReset(rb, txn);
+
/* If this txn is serialized then clean the disk space. */
if (rbtxn_is_serialized(txn))
{
--
1.8.3.1