You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ch...@apache.org on 2026/02/09 17:17:09 UTC

(cloudberry) branch cbdb-postgres-merge updated: Fix SignalBarrier

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

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this push:
     new 3faa3cfd3dd Fix SignalBarrier
3faa3cfd3dd is described below

commit 3faa3cfd3dd5b6e65cd1ef20e2dbb74523948f74
Author: Jinbao Chen <ch...@gmail.com>
AuthorDate: Tue Feb 10 01:16:58 2026 +0800

    Fix SignalBarrier
---
 src/backend/commands/dbcommands.c      | 6 +++---
 src/backend/utils/misc/faultinjector.c | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 22b8d6e33e7..6b5a0ae371a 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -3470,15 +3470,15 @@ dbase_redo(XLogReaderState *record)
 		}
 		pfree(parentdir);
 
+		/* Close all sgmr fds in all backends. */
+		WaitForProcSignalBarrier(EmitProcSignalBarrier(PROCSIGNAL_BARRIER_SMGRRELEASE));
+
 		/*
 		 * Force dirty buffers out to disk, to ensure source database is
 		 * up-to-date for the copy.
 		 */
 		FlushDatabaseBuffers(xlrec->src_db_id);
 
-		/* Close all sgmr fds in all backends. */
-		WaitForProcSignalBarrier(EmitProcSignalBarrier(PROCSIGNAL_BARRIER_SMGRRELEASE));
-
 		/*
 		 * Copy this subdirectory to the new location
 		 *
diff --git a/src/backend/utils/misc/faultinjector.c b/src/backend/utils/misc/faultinjector.c
index 1f411806fac..d23b6c3e585 100644
--- a/src/backend/utils/misc/faultinjector.c
+++ b/src/backend/utils/misc/faultinjector.c
@@ -876,6 +876,7 @@ FaultInjector_SetFaultInjection(
 				   entryLocal->faultInjectorState != FaultInjectorStateCompleted &&
 				   entryLocal->numTimesTriggered - entryLocal->startOccurrence < entry->extraArg - 1)
 			{
+				CHECK_FOR_INTERRUPTS();
 				pg_usleep(200000);  /* 0.2 sec */
 				retry_count--;
 				if (!retry_count)


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