Add CHECK_FOR_INTERRUPTS while restoring changes during decoding.
authorAmit Kapila <[email protected]>
Fri, 21 Oct 2022 06:52:47 +0000 (12:22 +0530)
committerAmit Kapila <[email protected]>
Fri, 21 Oct 2022 06:52:47 +0000 (12:22 +0530)
Previously in commit 42681dffaf, we added CFI during decoding changes but
missed another similar case that can happen while restoring changes
spilled to disk back into memory in a loop.

Reported-by: Robert Haas
Author: Amit Kapila
Backpatch-through: 10
Discussion: https://postgr.es/m/CA+TgmoaLObg0QbstbC8ykDwOdD1bDkr4AbPpB=0DPgA2JW0mFg@mail.gmail.com

src/backend/replication/logical/reorderbuffer.c

index 967e5227423b5c52e8ee55ed06e810756775f0b4..4b6adfb92b50ff6d0df8125060cc29ee9c072b92 100644 (file)
@@ -2830,6 +2830,8 @@ ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
        int         readBytes;
        ReorderBufferDiskChange *ondisk;
 
+       CHECK_FOR_INTERRUPTS();
+
        if (*fd == -1)
        {
            char        path[MAXPGPATH];