Add CHECK_FOR_INTERRUPTS while restoring changes during decoding.
authorAmit Kapila <[email protected]>
Fri, 21 Oct 2022 07:27:18 +0000 (12:57 +0530)
committerAmit Kapila <[email protected]>
Fri, 21 Oct 2022 07:27:18 +0000 (12:57 +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 f55bf4429014557f94950aeedce40e2309a2e7b7..c29894041e44e7257418af7225151025716934c4 100644 (file)
@@ -4171,6 +4171,8 @@ ReorderBufferRestoreChanges(ReorderBuffer *rb, ReorderBufferTXN *txn,
        int         readBytes;
        ReorderBufferDiskChange *ondisk;
 
+       CHECK_FOR_INTERRUPTS();
+
        if (*fd == -1)
        {
            char        path[MAXPGPATH];