* Process any new interrupts. */
| 554 | * Process any new interrupts. |
| 555 | */ |
| 556 | static void |
| 557 | HandleCheckpointerInterrupts(void) |
| 558 | { |
| 559 | if (ProcSignalBarrierPending) |
| 560 | ProcessProcSignalBarrier(); |
| 561 | |
| 562 | if (ConfigReloadPending) |
| 563 | { |
| 564 | ConfigReloadPending = false; |
| 565 | ProcessConfigFile(PGC_SIGHUP); |
| 566 | |
| 567 | /* |
| 568 | * Checkpointer is the last process to shut down, so we ask it to hold |
| 569 | * the keys for a range of other tasks required most of which have |
| 570 | * nothing to do with checkpointing at all. |
| 571 | * |
| 572 | * For various reasons, some config values can change dynamically so |
| 573 | * the primary copy of them is held in shared memory to make sure all |
| 574 | * backends see the same value. We make Checkpointer responsible for |
| 575 | * updating the shared memory copy if the parameter setting changes |
| 576 | * because of SIGHUP. |
| 577 | */ |
| 578 | UpdateSharedMemoryConfig(); |
| 579 | } |
| 580 | if (ShutdownRequestPending) |
| 581 | { |
| 582 | /* |
| 583 | * From here on, elog(ERROR) should end with exit(1), not send control |
| 584 | * back to the sigsetjmp block above |
| 585 | */ |
| 586 | ExitOnAnyError = true; |
| 587 | |
| 588 | /* |
| 589 | * Close down the database. |
| 590 | * |
| 591 | * Since ShutdownXLOG() creates restartpoint or checkpoint, and |
| 592 | * updates the statistics, increment the checkpoint request and send |
| 593 | * the statistics to the stats collector. |
| 594 | */ |
| 595 | BgWriterStats.m_requested_checkpoints++; |
| 596 | ShutdownXLOG(0, 0); |
| 597 | pgstat_send_bgwriter(); |
| 598 | pgstat_send_wal(true); |
| 599 | |
| 600 | /* Normal exit from the checkpointer is here */ |
| 601 | proc_exit(0); /* done */ |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | /* |
| 606 | * CheckArchiveTimeout -- check for archive_timeout and switch xlog files |
no test coverage detected