Dear Nisha,
Not sure, should we release a buffer pin if should_refetch_tuple() returns true?
I referred heapam_tuple_lock()/heap_lock_tuple(), they pin a buffer via
ReadBuffer()
and transfers to a slot via ExecStorePinnedBufferHeapTuple().
IIUC, ExecClearTuple() can release corresponding resources for the slot, so
below
fix is enough.
```
--- a/src/backend/executor/execReplication.c
+++ b/src/backend/executor/execReplication.c
@@ -268,7 +268,10 @@ retry:
PopActiveSnapshot();
if (should_refetch_tuple(res, &tmfd))
+ {
+ ExecClearTuple(*conflictslot);
goto retry;
+ }
```
Best regards,
Hayato Kuroda
FUJITSU LIMITED