You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ma...@apache.org on 2024/12/24 02:38:30 UTC

(cloudberry) 33/38: Add CHECK_FOR_INTERRUPTS in ExecInsert's speculative insertion loop.

This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit f18d54938219ed55e94ad644a990bf54260b363f
Author: Tom Lane <tg...@sss.pgh.pa.us>
AuthorDate: Thu Aug 4 14:10:06 2022 -0400

    Add CHECK_FOR_INTERRUPTS in ExecInsert's speculative insertion loop.
    
    Ordinarily the functions called in this loop ought to have plenty
    of CFIs themselves; but we've now seen a case where no such CFI is
    reached, making the loop uninterruptible.  Even though that's from
    a recently-introduced bug, it seems prudent to install a CFI at
    the loop level in all branches.
    
    Per discussion of bug #17558 from Andrew Kesper (an actual fix for
    that bug will follow).
    
    Discussion: https://postgr.es/m/17558-3f6599ffcf52fd4a@postgresql.org
---
 src/backend/executor/nodeModifyTable.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 7b326712e0..2fcab31e27 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -918,9 +918,11 @@ ExecInsert(ModifyTableState *mtstate,
 			 *
 			 * We loop back here if we find a conflict below, either during
 			 * the pre-check, or when we re-check after inserting the tuple
-			 * speculatively.
+			 * speculatively.  Better allow interrupts in case some bug makes
+			 * this an infinite loop.
 			 */
 	vlock:
+			CHECK_FOR_INTERRUPTS();
 			specConflict = false;
 			if (!ExecCheckIndexConstraints(resultRelInfo, slot, estate,
 										   &conflictTid, arbiterIndexes))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org