mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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 <nathandbossart@gmail.com> Discussion: https://www.postgresql.org/message-id/8a384b26-1499-41f6-be33-64b801fb98b8@iki.fi
This commit is contained in:
@ -158,7 +158,7 @@ static const struct
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Private functions. */
|
/* 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 void WaitForParallelWorkersToExit(ParallelContext *pcxt);
|
||||||
static parallel_worker_main_type LookupParallelWorkerFunction(const char *libraryname, const char *funcname);
|
static parallel_worker_main_type LookupParallelWorkerFunction(const char *libraryname, const char *funcname);
|
||||||
static void ParallelWorkerShutdown(int code, Datum arg);
|
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
|
* 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
|
* a flag that will cause the next CHECK_FOR_INTERRUPTS() to invoke
|
||||||
* HandleParallelMessages().
|
* ProcessParallelMessages().
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HandleParallelMessageInterrupt(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
|
void
|
||||||
HandleParallelMessages(void)
|
ProcessParallelMessages(void)
|
||||||
{
|
{
|
||||||
dlist_iter iter;
|
dlist_iter iter;
|
||||||
MemoryContext oldcontext;
|
MemoryContext oldcontext;
|
||||||
@ -1068,7 +1068,7 @@ HandleParallelMessages(void)
|
|||||||
*/
|
*/
|
||||||
if (hpm_context == NULL) /* first time through? */
|
if (hpm_context == NULL) /* first time through? */
|
||||||
hpm_context = AllocSetContextCreate(TopMemoryContext,
|
hpm_context = AllocSetContextCreate(TopMemoryContext,
|
||||||
"HandleParallelMessages",
|
"ProcessParallelMessages",
|
||||||
ALLOCSET_DEFAULT_SIZES);
|
ALLOCSET_DEFAULT_SIZES);
|
||||||
else
|
else
|
||||||
MemoryContextReset(hpm_context);
|
MemoryContextReset(hpm_context);
|
||||||
@ -1111,7 +1111,7 @@ HandleParallelMessages(void)
|
|||||||
|
|
||||||
initStringInfo(&msg);
|
initStringInfo(&msg);
|
||||||
appendBinaryStringInfo(&msg, data, nbytes);
|
appendBinaryStringInfo(&msg, data, nbytes);
|
||||||
HandleParallelMessage(pcxt, i, &msg);
|
ProcessParallelMessage(pcxt, i, &msg);
|
||||||
pfree(msg.data);
|
pfree(msg.data);
|
||||||
}
|
}
|
||||||
else
|
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
|
static void
|
||||||
HandleParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
|
ProcessParallelMessage(ParallelContext *pcxt, int i, StringInfo msg)
|
||||||
{
|
{
|
||||||
char msgtype;
|
char msgtype;
|
||||||
|
|
||||||
|
@ -1774,7 +1774,7 @@ PerformWalRecovery(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Handle interrupt signals of startup process */
|
/* Handle interrupt signals of startup process */
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pause WAL replay, if requested by a hot-standby session via
|
* 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 */
|
/* loop until recoveryPauseState is set to RECOVERY_NOT_PAUSED */
|
||||||
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
|
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
|
||||||
{
|
{
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
if (CheckForStandbyTrigger())
|
if (CheckForStandbyTrigger())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -3038,7 +3038,7 @@ recoveryApplyDelay(XLogReaderState *record)
|
|||||||
ResetLatch(&XLogRecoveryCtl->recoveryWakeupLatch);
|
ResetLatch(&XLogRecoveryCtl->recoveryWakeupLatch);
|
||||||
|
|
||||||
/* This might change recovery_min_apply_delay. */
|
/* This might change recovery_min_apply_delay. */
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
|
|
||||||
if (CheckForStandbyTrigger())
|
if (CheckForStandbyTrigger())
|
||||||
break;
|
break;
|
||||||
@ -3727,7 +3727,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
|||||||
now = GetCurrentTimestamp();
|
now = GetCurrentTimestamp();
|
||||||
|
|
||||||
/* Handle interrupt signals of startup process */
|
/* Handle interrupt signals of startup process */
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
}
|
}
|
||||||
last_fail_time = now;
|
last_fail_time = now;
|
||||||
currentSource = XLOG_FROM_ARCHIVE;
|
currentSource = XLOG_FROM_ARCHIVE;
|
||||||
@ -4017,7 +4017,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
|||||||
* This possibly-long loop needs to handle interrupts of startup
|
* This possibly-long loop needs to handle interrupts of startup
|
||||||
* process.
|
* process.
|
||||||
*/
|
*/
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
}
|
}
|
||||||
|
|
||||||
return XLREAD_FAIL; /* not reached */
|
return XLREAD_FAIL; /* not reached */
|
||||||
@ -4695,7 +4695,7 @@ RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue
|
|||||||
|
|
||||||
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
|
while (GetRecoveryPauseState() != RECOVERY_NOT_PAUSED)
|
||||||
{
|
{
|
||||||
HandleStartupProcInterrupts();
|
ProcessStartupProcInterrupts();
|
||||||
|
|
||||||
if (CheckForStandbyTrigger())
|
if (CheckForStandbyTrigger())
|
||||||
{
|
{
|
||||||
|
@ -316,7 +316,7 @@ static WorkerInfo MyWorkerInfo = NULL;
|
|||||||
int AutovacuumLauncherPid = 0;
|
int AutovacuumLauncherPid = 0;
|
||||||
|
|
||||||
static Oid do_start_worker(void);
|
static Oid do_start_worker(void);
|
||||||
static void HandleAutoVacLauncherInterrupts(void);
|
static void ProcessAutoVacLauncherInterrupts(void);
|
||||||
static void AutoVacLauncherShutdown(void) pg_attribute_noreturn();
|
static void AutoVacLauncherShutdown(void) pg_attribute_noreturn();
|
||||||
static void launcher_determine_sleep(bool canlaunch, bool recursing,
|
static void launcher_determine_sleep(bool canlaunch, bool recursing,
|
||||||
struct timeval *nap);
|
struct timeval *nap);
|
||||||
@ -594,7 +594,7 @@ AutoVacLauncherMain(const void *startup_data, size_t startup_data_len)
|
|||||||
|
|
||||||
ResetLatch(MyLatch);
|
ResetLatch(MyLatch);
|
||||||
|
|
||||||
HandleAutoVacLauncherInterrupts();
|
ProcessAutoVacLauncherInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a worker finished, or postmaster signaled failure to start a worker
|
* a worker finished, or postmaster signaled failure to start a worker
|
||||||
@ -742,7 +742,7 @@ AutoVacLauncherMain(const void *startup_data, size_t startup_data_len)
|
|||||||
* Process any new interrupts.
|
* Process any new interrupts.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HandleAutoVacLauncherInterrupts(void)
|
ProcessAutoVacLauncherInterrupts(void)
|
||||||
{
|
{
|
||||||
/* the normal shutdown case */
|
/* the normal shutdown case */
|
||||||
if (ShutdownRequestPending)
|
if (ShutdownRequestPending)
|
||||||
|
@ -226,7 +226,7 @@ BackgroundWriterMain(const void *startup_data, size_t startup_data_len)
|
|||||||
/* Clear any already-pending wakeups */
|
/* Clear any already-pending wakeups */
|
||||||
ResetLatch(MyLatch);
|
ResetLatch(MyLatch);
|
||||||
|
|
||||||
HandleMainLoopInterrupts();
|
ProcessMainLoopInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do one cycle of dirty-buffer writing.
|
* Do one cycle of dirty-buffer writing.
|
||||||
|
@ -157,7 +157,7 @@ static pg_time_t last_xlog_switch_time;
|
|||||||
|
|
||||||
/* Prototypes for private functions */
|
/* Prototypes for private functions */
|
||||||
|
|
||||||
static void HandleCheckpointerInterrupts(void);
|
static void ProcessCheckpointerInterrupts(void);
|
||||||
static void CheckArchiveTimeout(void);
|
static void CheckArchiveTimeout(void);
|
||||||
static bool IsCheckpointOnSchedule(double progress);
|
static bool IsCheckpointOnSchedule(double progress);
|
||||||
static bool ImmediateCheckpointRequested(void);
|
static bool ImmediateCheckpointRequested(void);
|
||||||
@ -359,7 +359,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
|
|||||||
*/
|
*/
|
||||||
AbsorbSyncRequests();
|
AbsorbSyncRequests();
|
||||||
|
|
||||||
HandleCheckpointerInterrupts();
|
ProcessCheckpointerInterrupts();
|
||||||
if (ShutdownXLOGPending || ShutdownRequestPending)
|
if (ShutdownXLOGPending || ShutdownRequestPending)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
|
|||||||
* We may have received an interrupt during the checkpoint and the
|
* We may have received an interrupt during the checkpoint and the
|
||||||
* latch might have been reset (e.g. in CheckpointWriteDelay).
|
* latch might have been reset (e.g. in CheckpointWriteDelay).
|
||||||
*/
|
*/
|
||||||
HandleCheckpointerInterrupts();
|
ProcessCheckpointerInterrupts();
|
||||||
if (ShutdownXLOGPending || ShutdownRequestPending)
|
if (ShutdownXLOGPending || ShutdownRequestPending)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -615,7 +615,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
|
|||||||
/* Clear any already-pending wakeups */
|
/* Clear any already-pending wakeups */
|
||||||
ResetLatch(MyLatch);
|
ResetLatch(MyLatch);
|
||||||
|
|
||||||
HandleCheckpointerInterrupts();
|
ProcessCheckpointerInterrupts();
|
||||||
|
|
||||||
if (ShutdownRequestPending)
|
if (ShutdownRequestPending)
|
||||||
break;
|
break;
|
||||||
@ -634,7 +634,7 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
|
|||||||
* Process any new interrupts.
|
* Process any new interrupts.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HandleCheckpointerInterrupts(void)
|
ProcessCheckpointerInterrupts(void)
|
||||||
{
|
{
|
||||||
if (ProcSignalBarrierPending)
|
if (ProcSignalBarrierPending)
|
||||||
ProcessProcSignalBarrier();
|
ProcessProcSignalBarrier();
|
||||||
|
@ -31,7 +31,7 @@ volatile sig_atomic_t ShutdownRequestPending = false;
|
|||||||
* Simple interrupt handler for main loops of background processes.
|
* Simple interrupt handler for main loops of background processes.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HandleMainLoopInterrupts(void)
|
ProcessMainLoopInterrupts(void)
|
||||||
{
|
{
|
||||||
if (ProcSignalBarrierPending)
|
if (ProcSignalBarrierPending)
|
||||||
ProcessProcSignalBarrier();
|
ProcessProcSignalBarrier();
|
||||||
@ -55,7 +55,7 @@ HandleMainLoopInterrupts(void)
|
|||||||
*
|
*
|
||||||
* Normally, this handler would be used for SIGHUP. The idea is that code
|
* Normally, this handler would be used for SIGHUP. The idea is that code
|
||||||
* which uses it would arrange to check the ConfigReloadPending flag at
|
* which uses it would arrange to check the ConfigReloadPending flag at
|
||||||
* convenient places inside main loops, or else call HandleMainLoopInterrupts.
|
* convenient places inside main loops, or else call ProcessMainLoopInterrupts.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
SignalHandlerForConfigReload(SIGNAL_ARGS)
|
SignalHandlerForConfigReload(SIGNAL_ARGS)
|
||||||
@ -99,7 +99,7 @@ SignalHandlerForCrashExit(SIGNAL_ARGS)
|
|||||||
* SIGINT or SIGTERM.
|
* SIGINT or SIGTERM.
|
||||||
*
|
*
|
||||||
* ShutdownRequestPending should be checked at a convenient place within the
|
* ShutdownRequestPending should be checked at a convenient place within the
|
||||||
* main loop, or else the main loop should call HandleMainLoopInterrupts.
|
* main loop, or else the main loop should call ProcessMainLoopInterrupts.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
SignalHandlerForShutdownRequest(SIGNAL_ARGS)
|
SignalHandlerForShutdownRequest(SIGNAL_ARGS)
|
||||||
|
@ -147,7 +147,7 @@ static bool pgarch_archiveXlog(char *xlog);
|
|||||||
static bool pgarch_readyXlog(char *xlog);
|
static bool pgarch_readyXlog(char *xlog);
|
||||||
static void pgarch_archiveDone(char *xlog);
|
static void pgarch_archiveDone(char *xlog);
|
||||||
static void pgarch_die(int code, Datum arg);
|
static void pgarch_die(int code, Datum arg);
|
||||||
static void HandlePgArchInterrupts(void);
|
static void ProcessPgArchInterrupts(void);
|
||||||
static int ready_file_comparator(Datum a, Datum b, void *arg);
|
static int ready_file_comparator(Datum a, Datum b, void *arg);
|
||||||
static void LoadArchiveLibrary(void);
|
static void LoadArchiveLibrary(void);
|
||||||
static void pgarch_call_module_shutdown_cb(int code, Datum arg);
|
static void pgarch_call_module_shutdown_cb(int code, Datum arg);
|
||||||
@ -324,7 +324,7 @@ pgarch_MainLoop(void)
|
|||||||
time_to_stop = ready_to_stop;
|
time_to_stop = ready_to_stop;
|
||||||
|
|
||||||
/* Check for barrier events and config update */
|
/* Check for barrier events and config update */
|
||||||
HandlePgArchInterrupts();
|
ProcessPgArchInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we've gotten SIGTERM, we normally just sit and do nothing until
|
* If we've gotten SIGTERM, we normally just sit and do nothing until
|
||||||
@ -415,7 +415,7 @@ pgarch_ArchiverCopyLoop(void)
|
|||||||
* we'll adopt a new setting for archive_command as soon as
|
* we'll adopt a new setting for archive_command as soon as
|
||||||
* possible, even if there is a backlog of files to be archived.
|
* possible, even if there is a backlog of files to be archived.
|
||||||
*/
|
*/
|
||||||
HandlePgArchInterrupts();
|
ProcessPgArchInterrupts();
|
||||||
|
|
||||||
/* Reset variables that might be set by the callback */
|
/* Reset variables that might be set by the callback */
|
||||||
arch_module_check_errdetail_string = NULL;
|
arch_module_check_errdetail_string = NULL;
|
||||||
@ -856,7 +856,7 @@ pgarch_die(int code, Datum arg)
|
|||||||
* shutdown request is different between those loops.
|
* shutdown request is different between those loops.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HandlePgArchInterrupts(void)
|
ProcessPgArchInterrupts(void)
|
||||||
{
|
{
|
||||||
if (ProcSignalBarrierPending)
|
if (ProcSignalBarrierPending)
|
||||||
ProcessProcSignalBarrier();
|
ProcessProcSignalBarrier();
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#ifndef USE_POSTMASTER_DEATH_SIGNAL
|
#ifndef USE_POSTMASTER_DEATH_SIGNAL
|
||||||
/*
|
/*
|
||||||
* On systems that need to make a system call to find out if the postmaster has
|
* On systems that need to make a system call to find out if the postmaster has
|
||||||
* gone away, we'll do so only every Nth call to HandleStartupProcInterrupts().
|
* gone away, we'll do so only every Nth call to ProcessStartupProcInterrupts().
|
||||||
* This only affects how long it takes us to detect the condition while we're
|
* This only affects how long it takes us to detect the condition while we're
|
||||||
* busy replaying WAL. Latch waits and similar which should react immediately
|
* busy replaying WAL. Latch waits and similar which should react immediately
|
||||||
* through the usual techniques.
|
* through the usual techniques.
|
||||||
@ -149,9 +149,9 @@ StartupRereadConfig(void)
|
|||||||
StartupRequestWalReceiverRestart();
|
StartupRequestWalReceiverRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle various signals that might be sent to the startup process */
|
/* Process various signals that might be sent to the startup process */
|
||||||
void
|
void
|
||||||
HandleStartupProcInterrupts(void)
|
ProcessStartupProcInterrupts(void)
|
||||||
{
|
{
|
||||||
#ifdef POSTMASTER_POLL_RATE_LIMIT
|
#ifdef POSTMASTER_POLL_RATE_LIMIT
|
||||||
static uint32 postmaster_poll_count = 0;
|
static uint32 postmaster_poll_count = 0;
|
||||||
|
@ -145,7 +145,7 @@ int wal_summary_keep_time = 10 * HOURS_PER_DAY * MINS_PER_HOUR;
|
|||||||
|
|
||||||
static void WalSummarizerShutdown(int code, Datum arg);
|
static void WalSummarizerShutdown(int code, Datum arg);
|
||||||
static XLogRecPtr GetLatestLSN(TimeLineID *tli);
|
static XLogRecPtr GetLatestLSN(TimeLineID *tli);
|
||||||
static void HandleWalSummarizerInterrupts(void);
|
static void ProcessWalSummarizerInterrupts(void);
|
||||||
static XLogRecPtr SummarizeWAL(TimeLineID tli, XLogRecPtr start_lsn,
|
static XLogRecPtr SummarizeWAL(TimeLineID tli, XLogRecPtr start_lsn,
|
||||||
bool exact, XLogRecPtr switch_lsn,
|
bool exact, XLogRecPtr switch_lsn,
|
||||||
XLogRecPtr maximum_lsn);
|
XLogRecPtr maximum_lsn);
|
||||||
@ -356,7 +356,7 @@ WalSummarizerMain(const void *startup_data, size_t startup_data_len)
|
|||||||
MemoryContextReset(context);
|
MemoryContextReset(context);
|
||||||
|
|
||||||
/* Process any signals received recently. */
|
/* Process any signals received recently. */
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
|
|
||||||
/* If it's time to remove any old WAL summaries, do that now. */
|
/* If it's time to remove any old WAL summaries, do that now. */
|
||||||
MaybeRemoveOldWalSummaries();
|
MaybeRemoveOldWalSummaries();
|
||||||
@ -856,7 +856,7 @@ GetLatestLSN(TimeLineID *tli)
|
|||||||
* Interrupt handler for main loop of WAL summarizer process.
|
* Interrupt handler for main loop of WAL summarizer process.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HandleWalSummarizerInterrupts(void)
|
ProcessWalSummarizerInterrupts(void)
|
||||||
{
|
{
|
||||||
if (ProcSignalBarrierPending)
|
if (ProcSignalBarrierPending)
|
||||||
ProcessProcSignalBarrier();
|
ProcessProcSignalBarrier();
|
||||||
@ -1016,7 +1016,7 @@ SummarizeWAL(TimeLineID tli, XLogRecPtr start_lsn, bool exact,
|
|||||||
XLogRecord *record;
|
XLogRecord *record;
|
||||||
uint8 rmid;
|
uint8 rmid;
|
||||||
|
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
|
|
||||||
/* We shouldn't go backward. */
|
/* We shouldn't go backward. */
|
||||||
Assert(summary_start_lsn <= xlogreader->EndRecPtr);
|
Assert(summary_start_lsn <= xlogreader->EndRecPtr);
|
||||||
@ -1503,7 +1503,7 @@ summarizer_read_local_xlog_page(XLogReaderState *state,
|
|||||||
WALReadError errinfo;
|
WALReadError errinfo;
|
||||||
SummarizerReadLocalXLogPrivate *private_data;
|
SummarizerReadLocalXLogPrivate *private_data;
|
||||||
|
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
|
|
||||||
private_data = (SummarizerReadLocalXLogPrivate *)
|
private_data = (SummarizerReadLocalXLogPrivate *)
|
||||||
state->private_data;
|
state->private_data;
|
||||||
@ -1541,7 +1541,7 @@ summarizer_read_local_xlog_page(XLogReaderState *state,
|
|||||||
* current timeline, so more data might show up. Delay here
|
* current timeline, so more data might show up. Delay here
|
||||||
* so we don't tight-loop.
|
* so we don't tight-loop.
|
||||||
*/
|
*/
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
summarizer_wait_for_wal();
|
summarizer_wait_for_wal();
|
||||||
|
|
||||||
/* Recheck end-of-WAL. */
|
/* Recheck end-of-WAL. */
|
||||||
@ -1692,7 +1692,7 @@ MaybeRemoveOldWalSummaries(void)
|
|||||||
XLogRecPtr oldest_lsn = InvalidXLogRecPtr;
|
XLogRecPtr oldest_lsn = InvalidXLogRecPtr;
|
||||||
TimeLineID selected_tli;
|
TimeLineID selected_tli;
|
||||||
|
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pick a timeline for which some summary files still exist on disk,
|
* Pick a timeline for which some summary files still exist on disk,
|
||||||
@ -1711,7 +1711,7 @@ MaybeRemoveOldWalSummaries(void)
|
|||||||
{
|
{
|
||||||
WalSummaryFile *ws = lfirst(lc);
|
WalSummaryFile *ws = lfirst(lc);
|
||||||
|
|
||||||
HandleWalSummarizerInterrupts();
|
ProcessWalSummarizerInterrupts();
|
||||||
|
|
||||||
/* If it's not on this timeline, it's not time to consider it. */
|
/* If it's not on this timeline, it's not time to consider it. */
|
||||||
if (selected_tli != ws->tli)
|
if (selected_tli != ws->tli)
|
||||||
|
@ -239,7 +239,7 @@ WalWriterMain(const void *startup_data, size_t startup_data_len)
|
|||||||
ResetLatch(MyLatch);
|
ResetLatch(MyLatch);
|
||||||
|
|
||||||
/* Process any signals received recently */
|
/* Process any signals received recently */
|
||||||
HandleMainLoopInterrupts();
|
ProcessMainLoopInterrupts();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do what we're here for; then, if XLogBackgroundFlush() found useful
|
* Do what we're here for; then, if XLogBackgroundFlush() found useful
|
||||||
|
@ -983,7 +983,7 @@ ParallelApplyWorkerMain(Datum main_arg)
|
|||||||
*
|
*
|
||||||
* Note: this is called within a signal handler! All we can do is set a flag
|
* 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
|
* that will cause the next CHECK_FOR_INTERRUPTS() to invoke
|
||||||
* HandleParallelApplyMessages().
|
* ProcessParallelApplyMessages().
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HandleParallelApplyMessageInterrupt(void)
|
HandleParallelApplyMessageInterrupt(void)
|
||||||
@ -994,11 +994,11 @@ HandleParallelApplyMessageInterrupt(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle a single protocol message received from a single parallel apply
|
* Process a single protocol message received from a single parallel apply
|
||||||
* worker.
|
* worker.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
HandleParallelApplyMessage(StringInfo msg)
|
ProcessParallelApplyMessage(StringInfo msg)
|
||||||
{
|
{
|
||||||
char msgtype;
|
char msgtype;
|
||||||
|
|
||||||
@ -1060,7 +1060,7 @@ HandleParallelApplyMessage(StringInfo msg)
|
|||||||
* Handle any queued protocol messages received from parallel apply workers.
|
* Handle any queued protocol messages received from parallel apply workers.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
HandleParallelApplyMessages(void)
|
ProcessParallelApplyMessages(void)
|
||||||
{
|
{
|
||||||
ListCell *lc;
|
ListCell *lc;
|
||||||
MemoryContext oldcontext;
|
MemoryContext oldcontext;
|
||||||
@ -1083,7 +1083,7 @@ HandleParallelApplyMessages(void)
|
|||||||
*/
|
*/
|
||||||
if (!hpam_context) /* first time through? */
|
if (!hpam_context) /* first time through? */
|
||||||
hpam_context = AllocSetContextCreate(TopMemoryContext,
|
hpam_context = AllocSetContextCreate(TopMemoryContext,
|
||||||
"HandleParallelApplyMessages",
|
"ProcessParallelApplyMessages",
|
||||||
ALLOCSET_DEFAULT_SIZES);
|
ALLOCSET_DEFAULT_SIZES);
|
||||||
else
|
else
|
||||||
MemoryContextReset(hpam_context);
|
MemoryContextReset(hpam_context);
|
||||||
@ -1118,7 +1118,7 @@ HandleParallelApplyMessages(void)
|
|||||||
|
|
||||||
initStringInfo(&msg);
|
initStringInfo(&msg);
|
||||||
appendBinaryStringInfo(&msg, data, nbytes);
|
appendBinaryStringInfo(&msg, data, nbytes);
|
||||||
HandleParallelApplyMessage(&msg);
|
ProcessParallelApplyMessage(&msg);
|
||||||
pfree(msg.data);
|
pfree(msg.data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3494,13 +3494,13 @@ ProcessInterrupts(void)
|
|||||||
ProcessProcSignalBarrier();
|
ProcessProcSignalBarrier();
|
||||||
|
|
||||||
if (ParallelMessagePending)
|
if (ParallelMessagePending)
|
||||||
HandleParallelMessages();
|
ProcessParallelMessages();
|
||||||
|
|
||||||
if (LogMemoryContextPending)
|
if (LogMemoryContextPending)
|
||||||
ProcessLogMemoryContextInterrupt();
|
ProcessLogMemoryContextInterrupt();
|
||||||
|
|
||||||
if (ParallelApplyMessagePending)
|
if (ParallelApplyMessagePending)
|
||||||
HandleParallelApplyMessages();
|
ProcessParallelApplyMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -71,7 +71,7 @@ extern void DestroyParallelContext(ParallelContext *pcxt);
|
|||||||
extern bool ParallelContextActive(void);
|
extern bool ParallelContextActive(void);
|
||||||
|
|
||||||
extern void HandleParallelMessageInterrupt(void);
|
extern void HandleParallelMessageInterrupt(void);
|
||||||
extern void HandleParallelMessages(void);
|
extern void ProcessParallelMessages(void);
|
||||||
extern void AtEOXact_Parallel(bool isCommit);
|
extern void AtEOXact_Parallel(bool isCommit);
|
||||||
extern void AtEOSubXact_Parallel(bool isCommit, SubTransactionId mySubId);
|
extern void AtEOSubXact_Parallel(bool isCommit, SubTransactionId mySubId);
|
||||||
extern void ParallelWorkerReportLastRecEnd(XLogRecPtr last_xlog_end);
|
extern void ParallelWorkerReportLastRecEnd(XLogRecPtr last_xlog_end);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
extern PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending;
|
extern PGDLLIMPORT volatile sig_atomic_t ConfigReloadPending;
|
||||||
extern PGDLLIMPORT volatile sig_atomic_t ShutdownRequestPending;
|
extern PGDLLIMPORT volatile sig_atomic_t ShutdownRequestPending;
|
||||||
|
|
||||||
extern void HandleMainLoopInterrupts(void);
|
extern void ProcessMainLoopInterrupts(void);
|
||||||
extern void SignalHandlerForConfigReload(SIGNAL_ARGS);
|
extern void SignalHandlerForConfigReload(SIGNAL_ARGS);
|
||||||
extern void SignalHandlerForCrashExit(SIGNAL_ARGS);
|
extern void SignalHandlerForCrashExit(SIGNAL_ARGS);
|
||||||
extern void SignalHandlerForShutdownRequest(SIGNAL_ARGS);
|
extern void SignalHandlerForShutdownRequest(SIGNAL_ARGS);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
extern PGDLLIMPORT int log_startup_progress_interval;
|
extern PGDLLIMPORT int log_startup_progress_interval;
|
||||||
|
|
||||||
extern void HandleStartupProcInterrupts(void);
|
extern void ProcessStartupProcInterrupts(void);
|
||||||
extern void StartupProcessMain(const void *startup_data, size_t startup_data_len) pg_attribute_noreturn();
|
extern void StartupProcessMain(const void *startup_data, size_t startup_data_len) pg_attribute_noreturn();
|
||||||
extern void PreRestoreCommand(void);
|
extern void PreRestoreCommand(void);
|
||||||
extern void PostRestoreCommand(void);
|
extern void PostRestoreCommand(void);
|
||||||
|
@ -24,7 +24,7 @@ extern bool IsLogicalWorker(void);
|
|||||||
extern bool IsLogicalParallelApplyWorker(void);
|
extern bool IsLogicalParallelApplyWorker(void);
|
||||||
|
|
||||||
extern void HandleParallelApplyMessageInterrupt(void);
|
extern void HandleParallelApplyMessageInterrupt(void);
|
||||||
extern void HandleParallelApplyMessages(void);
|
extern void ProcessParallelApplyMessages(void);
|
||||||
|
|
||||||
extern void LogicalRepWorkersWakeupAtCommit(Oid subid);
|
extern void LogicalRepWorkersWakeupAtCommit(Oid subid);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user