summaryrefslogtreecommitdiff
path: root/src/backend/access/transam
diff options
context:
space:
mode:
authorHeikki Linnakangas2025-03-05 14:22:26 +0000
committerHeikki Linnakangas2025-03-05 14:22:26 +0000
commit635f580120b99f6df71d7c12749b22acde61c5ad (patch)
treec9426b1738ae53c81ba419aa5f2dafff0ba6be32 /src/backend/access/transam
parentf4e53e10b6ce0eedeb98caa4356facb47c7bb9cb (diff)
Rename some signal and interrupt handling functions for consistency
The usual pattern for handling a signal is that the signal handler sets a flag and calls SetLatch(MyLatch), and CHECK_FOR_INTERRUPTS() or other code that is part of a wait loop calls another function to deal with it. The naming of the functions involved was a bit inconsistent, however. CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() to do the heavy-lifting, but the analogous functions in aux processes were called HandleMainLoopInterrupts(), HandleStartupProcInterrupts(), etc. Similarly, most subroutines of ProcessInterrupts() were called Process*(), but some were called Handle*(). To make things less confusing, rename all the functions that are part of the overall signal/interrupt handling system but are not executed in a signal handler to e.g. ProcessSomething(), rather than HandleSomething(). The "Process" prefix is now consistently used in the non-signal-handler functions, and the "Handle" prefix in functions that are part of signal handlers, except for some completely unrelated functions that clearly have nothing to do with signal or interrupt handling. Reviewed-by: Nathan Bossart <[email protected]> Discussion: https://www.postgresql.org/message-id/[email protected]
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r--src/backend/access/transam/parallel.c16
-rw-r--r--src/backend/access/transam/xlogrecovery.c12
2 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index f6d81d6e1fc..94db1ec3012 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -158,7 +158,7 @@ static const struct
};
/* Private functions. */
-static void HandleParallelMessage(ParallelContext *pcxt, int i, StringInfo msg);
+static void ProcessParallelMessage(ParallelContext *pcxt, int i, StringInfo msg);
static void WaitForParallelWorkersToExit(ParallelContext *pcxt);
static parallel_worker_main_type LookupParallelWorkerFunction(const char *libraryname, const char *funcname);
static void ParallelWorkerShutdown(int code, Datum arg);
@@ -1031,7 +1031,7 @@ ParallelContextActive(void)
*
* Note: this is called within a signal handler! All we can do is set
* a flag that will cause the next CHECK_FOR_INTERRUPTS() to invoke
- * HandleParallelMessages().
+ * ProcessParallelMessages().
*/
void
HandleParallelMessageInterrupt(void)
@@ -1042,10 +1042,10 @@ HandleParallelMessageInterrupt(void)
}
/*
- * Handle any queued protocol messages received from parallel workers.
+ * Process any queued protocol messages received from parallel workers.
*/
void
-HandleParallelMessages(void)
+ProcessParallelMessages(void)
{
dlist_iter iter;
MemoryContext oldcontext;
@@ -1068,7 +1068,7 @@ HandleParallelMessages(void)
*/
if (hpm_context == NULL) /* first time through? */
hpm_context = AllocSetContextCreate(TopMemoryContext,
- "HandleParallelMessages",
+ "ProcessParallelMessages",
ALLOCSET_DEFAULT_SIZES);
else
MemoryContextReset(hpm_context);
@@ -1111,7 +1111,7 @@ HandleParallelMessages(void)
initStringInfo(&msg);
appendBinaryStringInfo(&msg, data, nbytes);
- HandleParallelMessage(pcxt, i, &msg);
+ ProcessParallelMessage(pcxt, i, &msg);
pfree(msg.data);
}
else
@@ -1131,10 +1131,10 @@ HandleParallelMessages(void)
}
/*
- * Handle a single protocol message received from a single parallel worker.
+ * Process a single protocol message received from a single parallel worker.
*/
static void
-HandleParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
+ProcessParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
{
char msgtype;
diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c
index 52f53fa12e0..a829a055a97 100644
--- a/src/backend/access/transam/xlogrecovery.c
+++ b/src/backend/access/transam/xlogrecovery.c
@@ -1774,7 +1774,7 @@ PerformWalRecovery(void)
#endif
/* Handle interrupt signals of startup process */
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
/*
* Pause WAL replay, if requested by a hot-standby session via
@@ -2949,7 +2949,7 @@ recoveryPausesHere(bool endOfRecovery)
/* loop until recoveryPauseState is set to RECOVERY_NOT_PAUSED */
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
{
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
if (CheckForStandbyTrigger())
return;
@@ -3038,7 +3038,7 @@ recoveryApplyDelay(XLogReaderState *record)
ResetLatch(&XLogRecoveryCtl->recoveryWakeupLatch);
/* This might change recovery_min_apply_delay. */
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
if (CheckForStandbyTrigger())
break;
@@ -3727,7 +3727,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
now = GetCurrentTimestamp();
/* Handle interrupt signals of startup process */
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
}
last_fail_time = now;
currentSource = XLOG_FROM_ARCHIVE;
@@ -4017,7 +4017,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
* This possibly-long loop needs to handle interrupts of startup
* process.
*/
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
}
return XLREAD_FAIL; /* not reached */
@@ -4695,7 +4695,7 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
{
- HandleStartupProcInterrupts();
+ ProcessStartupProcInterrupts();
if (CheckForStandbyTrigger())
{