PostgreSQL Source Code git master
Loading...
Searching...
No Matches
datachecksum_state.h File Reference
Include dependency graph for datachecksum_state.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum DataChecksumsWorkerOperation DataChecksumsWorkerOperation
 

Enumerations

enum  DataChecksumsWorkerOperation { ENABLE_DATACHECKSUMS , DISABLE_DATACHECKSUMS }
 
enum  DataChecksumsWorkerResult { DATACHECKSUMSWORKER_SUCCESSFUL = 0 , DATACHECKSUMSWORKER_ABORTED , DATACHECKSUMSWORKER_FAILED , DATACHECKSUMSWORKER_DROPDB }
 

Functions

bool AbsorbDataChecksumsBarrier (ProcSignalBarrierType barrier)
 
void EmitAndWaitDataChecksumsBarrier (uint32 state)
 
void StartDataChecksumsWorkerLauncher (DataChecksumsWorkerOperation op, int cost_delay, int cost_limit)
 
void DataChecksumsWorkerLauncherMain (Datum arg)
 
void DataChecksumsWorkerMain (Datum arg)
 

Typedef Documentation

◆ DataChecksumsWorkerOperation

Enumeration Type Documentation

◆ DataChecksumsWorkerOperation

Enumerator
ENABLE_DATACHECKSUMS 
DISABLE_DATACHECKSUMS 

Definition at line 21 of file datachecksum_state.h.

◆ DataChecksumsWorkerResult

Enumerator
DATACHECKSUMSWORKER_SUCCESSFUL 
DATACHECKSUMSWORKER_ABORTED 
DATACHECKSUMSWORKER_FAILED 
DATACHECKSUMSWORKER_DROPDB 

Definition at line 31 of file datachecksum_state.h.

Function Documentation

◆ AbsorbDataChecksumsBarrier()

bool AbsorbDataChecksumsBarrier ( ProcSignalBarrierType  barrier)

Definition at line 433 of file datachecksum_state.c.

434{
436 int current = data_checksums;
437 bool found = false;
438
439 /*
440 * Translate the barrier condition to the target state, doing it here
441 * instead of in the procsignal code saves the latter from knowing about
442 * checksum states.
443 */
444 switch (barrier)
445 {
448 break;
451 break;
454 break;
457 break;
458 default:
459 elog(ERROR, "incorrect barrier \"%i\" received", barrier);
460 }
461
462 /*
463 * If the target state matches the current state then the barrier has been
464 * repeated.
465 */
466 if (current == target_state)
467 return true;
468
469 /*
470 * If the cluster is in recovery we skip the validation of current state
471 * since the replay is trusted.
472 */
473 if (RecoveryInProgress())
474 {
476 return true;
477 }
478
479 /*
480 * Find the barrier condition definition for the target state. Not finding
481 * a condition would be a grave programmer error as the states are a
482 * discrete set.
483 */
484 for (int i = 0; i < lengthof(checksum_barriers) && !found; i++)
485 {
486 if (checksum_barriers[i].from == current && checksum_barriers[i].to == target_state)
487 found = true;
488 }
489
490 /*
491 * If the relevant state criteria aren't satisfied, throw an error which
492 * will be caught by the procsignal machinery for a later retry.
493 */
494 if (!found)
497 errmsg("incorrect data checksum state %i for target state %i",
498 current, target_state));
499
501 return true;
502}
uint32_t uint32
Definition c.h:624
#define lengthof(array)
Definition c.h:873
@ PG_DATA_CHECKSUM_VERSION
Definition checksum.h:29
@ PG_DATA_CHECKSUM_INPROGRESS_OFF
Definition checksum.h:30
@ PG_DATA_CHECKSUM_INPROGRESS_ON
Definition checksum.h:31
@ PG_DATA_CHECKSUM_OFF
Definition checksum.h:28
static const ChecksumBarrierCondition checksum_barriers[9]
int errcode(int sqlerrcode)
Definition elog.c:875
#define ERROR
Definition elog.h:40
#define elog(elevel,...)
Definition elog.h:228
#define ereport(elevel,...)
Definition elog.h:152
int i
Definition isn.c:77
static char * errmsg
static THREAD_BARRIER_T barrier
Definition pgbench.c:488
static int fb(int x)
@ PROCSIGNAL_BARRIER_CHECKSUM_INPROGRESS_OFF
Definition procsignal.h:55
@ PROCSIGNAL_BARRIER_CHECKSUM_INPROGRESS_ON
Definition procsignal.h:54
@ PROCSIGNAL_BARRIER_CHECKSUM_ON
Definition procsignal.h:56
@ PROCSIGNAL_BARRIER_CHECKSUM_OFF
Definition procsignal.h:53
bool RecoveryInProgress(void)
Definition xlog.c:6832
void SetLocalDataChecksumState(uint32 data_checksum_version)
Definition xlog.c:4971
int data_checksums
Definition xlog.c:683

References barrier, checksum_barriers, data_checksums, elog, ereport, errcode(), errmsg, ERROR, fb(), i, lengthof, PG_DATA_CHECKSUM_INPROGRESS_OFF, PG_DATA_CHECKSUM_INPROGRESS_ON, PG_DATA_CHECKSUM_OFF, PG_DATA_CHECKSUM_VERSION, PROCSIGNAL_BARRIER_CHECKSUM_INPROGRESS_OFF, PROCSIGNAL_BARRIER_CHECKSUM_INPROGRESS_ON, PROCSIGNAL_BARRIER_CHECKSUM_OFF, PROCSIGNAL_BARRIER_CHECKSUM_ON, RecoveryInProgress(), and SetLocalDataChecksumState().

Referenced by ProcessProcSignalBarrier().

◆ DataChecksumsWorkerLauncherMain()

void DataChecksumsWorkerLauncherMain ( Datum  arg)

Definition at line 1055 of file datachecksum_state.c.

1056{
1057
1059 errmsg("background worker \"datachecksums launcher\" started"));
1060
1065
1067
1070
1071 INJECTION_POINT("datachecksumsworker-launcher-delay", NULL);
1072
1074
1076 {
1077 ereport(LOG,
1078 errmsg("background worker \"datachecksums launcher\" already running, exiting"));
1079 /* Launcher was already running, let it finish */
1081 return;
1082 }
1083
1085 launcher_running = true;
1086
1087 /* Initialize a connection to shared catalogs only */
1089
1096
1097 /*
1098 * The target state can change while we are busy enabling/disabling
1099 * checksums, if the user calls pg_disable/enable_data_checksums() before
1100 * we are finished with the previous request. In that case, we will loop
1101 * back here, to process the new request.
1102 */
1103again:
1104
1106 InvalidOid);
1107
1109 {
1110 /*
1111 * If we are asked to enable checksums in a cluster which already has
1112 * checksums enabled, exit immediately as there is nothing more to do.
1113 */
1115 goto done;
1116
1117 ereport(LOG,
1118 errmsg("enabling data checksums requested, starting data checksum calculation"));
1119
1120 /*
1121 * Set the state to inprogress-on and wait on the procsignal barrier.
1122 */
1126
1127 /*
1128 * All backends are now in inprogress-on state and are writing data
1129 * checksums. Start processing all data at rest.
1130 */
1131 if (!ProcessAllDatabases())
1132 {
1133 /*
1134 * If the target state changed during processing then it's not a
1135 * failure, so restart processing instead.
1136 */
1139 {
1141 goto done;
1142 }
1144 ereport(ERROR,
1146 errmsg("unable to enable data checksums in cluster"));
1147 }
1148
1149 /*
1150 * Data checksums have been set on all pages, set the state to on in
1151 * order to instruct backends to validate checksums on reading.
1152 */
1154
1155 ereport(LOG,
1156 errmsg("data checksums are now enabled"));
1157 }
1158 else if (operation == DISABLE_DATACHECKSUMS)
1159 {
1160 ereport(LOG,
1161 errmsg("disabling data checksums requested"));
1162
1166 ereport(LOG,
1167 errmsg("data checksums are now disabled"));
1168 }
1169 else
1170 Assert(false);
1171
1172done:
1173
1174 /*
1175 * This state will only be displayed for a fleeting moment, but for the
1176 * sake of correctness it is still added before ending the command.
1177 */
1180
1181 /*
1182 * All done. But before we exit, check if the target state was changed
1183 * while we were running. In that case we will have to start all over
1184 * again.
1185 */
1188 {
1194 goto again;
1195 }
1196
1197 /* Shut down progress reporting as we are done */
1199
1200 launcher_running = false;
1203}
void pgstat_progress_start_command(ProgressCommandType cmdtype, Oid relid)
void pgstat_progress_update_param(int index, int64 val)
void pgstat_progress_end_command(void)
@ PROGRESS_COMMAND_DATACHECKSUMS
void BackgroundWorkerUnblockSignals(void)
Definition bgworker.c:949
void BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid, uint32 flags)
Definition bgworker.c:909
#define Assert(condition)
Definition c.h:943
static DataChecksumsStateStruct * DataChecksumState
static volatile sig_atomic_t launcher_running
static DataChecksumsWorkerOperation operation
static void launcher_cancel_handler(SIGNAL_ARGS)
static bool ProcessAllDatabases(void)
static void launcher_exit(int code, Datum arg)
#define LOG
Definition elog.h:32
#define DEBUG1
Definition elog.h:31
#define INJECTION_POINT(name, arg)
void on_shmem_exit(pg_on_exit_callback function, Datum arg)
Definition ipc.c:372
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition lwlock.c:1150
void LWLockRelease(LWLock *lock)
Definition lwlock.c:1767
@ LW_EXCLUSIVE
Definition lwlock.h:104
@ B_DATACHECKSUMSWORKER_LAUNCHER
Definition miscadmin.h:382
BackendType MyBackendType
Definition miscinit.c:65
#define die(msg)
#define pqsignal
Definition port.h:548
#define PG_SIG_IGN
Definition port.h:552
#define InvalidOid
void procsignal_sigusr1_handler(SIGNAL_ARGS)
Definition procsignal.c:688
#define PROGRESS_DATACHECKSUMS_PHASE_DONE
Definition progress.h:205
#define PROGRESS_DATACHECKSUMS_PHASE
Definition progress.h:192
#define PROGRESS_DATACHECKSUMS_PHASE_ENABLING
Definition progress.h:201
#define PROGRESS_DATACHECKSUMS_PHASE_DISABLING
Definition progress.h:202
void init_ps_display(const char *fixed_part)
Definition ps_status.c:286
DataChecksumsWorkerOperation launch_operation
DataChecksumsWorkerOperation operation
#define SIGUSR1
Definition win32_port.h:170
#define SIGUSR2
Definition win32_port.h:171
void SetDataChecksumsOff(void)
Definition xlog.c:4867
bool DataChecksumsNeedVerify(void)
Definition xlog.c:4733
void SetDataChecksumsOn(void)
Definition xlog.c:4802
void SetDataChecksumsOnInProgress(void)
Definition xlog.c:4749

References Assert, B_DATACHECKSUMSWORKER_LAUNCHER, BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerUnblockSignals(), DataChecksumsStateStruct::cost_delay, DataChecksumsStateStruct::cost_limit, DataChecksumsNeedVerify(), DataChecksumState, DEBUG1, die, DISABLE_DATACHECKSUMS, ENABLE_DATACHECKSUMS, ereport, errcode(), errmsg, ERROR, fb(), init_ps_display(), INJECTION_POINT, InvalidOid, DataChecksumsStateStruct::launch_cost_delay, DataChecksumsStateStruct::launch_cost_limit, DataChecksumsStateStruct::launch_operation, launcher_cancel_handler(), launcher_exit(), DataChecksumsStateStruct::launcher_running, launcher_running, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyBackendType, on_shmem_exit(), DataChecksumsStateStruct::operation, operation, PG_SIG_IGN, pgstat_progress_end_command(), pgstat_progress_start_command(), pgstat_progress_update_param(), pqsignal, ProcessAllDatabases(), procsignal_sigusr1_handler(), PROGRESS_COMMAND_DATACHECKSUMS, PROGRESS_DATACHECKSUMS_PHASE, PROGRESS_DATACHECKSUMS_PHASE_DISABLING, PROGRESS_DATACHECKSUMS_PHASE_DONE, PROGRESS_DATACHECKSUMS_PHASE_ENABLING, SetDataChecksumsOff(), SetDataChecksumsOn(), SetDataChecksumsOnInProgress(), SIGUSR1, and SIGUSR2.

◆ DataChecksumsWorkerMain()

void DataChecksumsWorkerMain ( Datum  arg)

Definition at line 1510 of file datachecksum_state.c.

1511{
1512 Oid dboid = DatumGetObjectId(arg);
1515 BufferAccessStrategy strategy;
1516 bool aborted = false;
1518#ifdef USE_INJECTION_POINTS
1519 bool retried = false;
1520#endif
1521
1523
1526
1528
1531
1534
1535 /* worker will have a separate entry in pg_stat_progress_data_checksums */
1537 InvalidOid);
1538
1539 /*
1540 * Get a list of all temp tables present as we start in this database. We
1541 * need to wait until they are all gone until we are done, since we cannot
1542 * access these relations and modify them.
1543 */
1545
1546 /*
1547 * Enable vacuum cost delay, if any. While this process isn't doing any
1548 * vacuuming, we are re-using the infrastructure that vacuum cost delay
1549 * provides rather than inventing something bespoke. This is an internal
1550 * implementation detail and care should be taken to avoid it bleeding
1551 * through to the user to avoid confusion.
1552 *
1553 * VacuumUpdateCosts() propagates the values to the variables actually
1554 * read by vacuum_delay_point().
1555 */
1560
1561 /*
1562 * Create and set the vacuum strategy as our buffer strategy.
1563 */
1564 strategy = GetAccessStrategy(BAS_VACUUM);
1565
1568
1569 /* Update the total number of relations to be processed in this DB. */
1570 {
1571 const int index[] = {
1574 };
1575
1576 int64 vals[2];
1577
1578 vals[0] = list_length(RelationList);
1579 vals[1] = 0;
1580
1582 }
1583
1584 /* Process the relations */
1585 rels_done = 0;
1586 foreach_oid(reloid, RelationList)
1587 {
1588 bool costs_updated = false;
1589
1590 if (!ProcessSingleRelationByOid(reloid, strategy))
1591 {
1592 aborted = true;
1593 break;
1594 }
1595
1597 ++rels_done);
1600
1601 if (abort_requested)
1602 break;
1603
1604 /*
1605 * Check if the cost settings changed during runtime and if so, update
1606 * to reflect the new values and signal that the access strategy needs
1607 * to be refreshed.
1608 */
1612 {
1613 costs_updated = true;
1617
1620 }
1621 else
1622 costs_updated = false;
1624
1625 if (costs_updated)
1626 {
1627 FreeAccessStrategy(strategy);
1628 strategy = GetAccessStrategy(BAS_VACUUM);
1629 }
1630 }
1631
1633 FreeAccessStrategy(strategy);
1634
1635 if (aborted || abort_requested)
1636 {
1641 errmsg("data checksum processing aborted in database OID %u",
1642 dboid));
1643 return;
1644 }
1645
1646 /* The worker is about to wait for temporary tables to go away. */
1649
1650 /*
1651 * Wait for all temp tables that existed when we started to go away. This
1652 * is necessary since we cannot "reach" them to enable checksums. Any temp
1653 * tables created after we started will already have checksums in them
1654 * (due to the "inprogress-on" state), so no need to wait for those.
1655 */
1656 for (;;)
1657 {
1659 int numleft;
1660 char activity[64];
1661
1662 CurrentTempTables = BuildRelationList(true, false);
1663 numleft = 0;
1665 {
1667 numleft++;
1668 }
1670
1671#ifdef USE_INJECTION_POINTS
1672 if (IS_INJECTION_POINT_ATTACHED("datachecksumsworker-fake-temptable-wait"))
1673 {
1674 /* Make sure to just cause one retry */
1675 if (!retried && numleft == 0)
1676 {
1677 numleft = 1;
1678 retried = true;
1679
1680 INJECTION_POINT_CACHED("datachecksumsworker-fake-temptable-wait", NULL);
1681 }
1682 }
1683#endif
1684
1685 if (numleft == 0)
1686 break;
1687
1688 /*
1689 * At least one temp table is left to wait for, indicate in pgstat
1690 * activity and progress reporting.
1691 */
1693 sizeof(activity),
1694 "Waiting for %d temp tables to be removed", numleft);
1696
1697 /* Retry every 3 seconds */
1701 3000,
1703
1706
1707 if (aborted || abort_requested)
1708 {
1712 ereport(LOG,
1713 errmsg("data checksum processing aborted in database OID %u",
1714 dboid));
1715 return;
1716 }
1717 }
1718
1720
1721 /* worker done */
1723
1727}
void VacuumUpdateCosts(void)
void pgstat_progress_update_multi_param(int nparam, const int *index, const int64 *val)
void pgstat_report_activity(BackendState state, const char *cmd_str)
@ STATE_RUNNING
#define BGWORKER_BYPASS_ALLOWCONN
Definition bgworker.h:166
@ BAS_VACUUM
Definition bufmgr.h:40
int64_t int64
Definition c.h:621
static volatile sig_atomic_t abort_requested
static bool ProcessSingleRelationByOid(Oid relationId, BufferAccessStrategy strategy)
#define CHECK_FOR_ABORT_REQUEST()
static List * BuildRelationList(bool temp_relations, bool include_shared)
Datum arg
Definition elog.c:1323
BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype)
Definition freelist.c:426
void FreeAccessStrategy(BufferAccessStrategy strategy)
Definition freelist.c:608
int VacuumCostLimit
Definition globals.c:157
int VacuumCostBalance
Definition globals.c:160
struct Latch * MyLatch
Definition globals.c:65
double VacuumCostDelay
Definition globals.c:158
#define IS_INJECTION_POINT_ATTACHED(name)
#define INJECTION_POINT_CACHED(name, arg)
void ResetLatch(Latch *latch)
Definition latch.c:374
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
Definition latch.c:172
void list_free(List *list)
Definition list.c:1546
bool list_member_oid(const List *list, Oid datum)
Definition list.c:722
#define CHECK_FOR_INTERRUPTS()
Definition miscadmin.h:125
@ B_DATACHECKSUMSWORKER_WORKER
Definition miscadmin.h:383
static int list_length(const List *l)
Definition pg_list.h:152
#define NIL
Definition pg_list.h:68
#define foreach_oid(var, lst)
Definition pg_list.h:503
#define snprintf
Definition port.h:261
static Oid DatumGetObjectId(Datum X)
Definition postgres.h:242
unsigned int Oid
#define PROGRESS_DATACHECKSUMS_RELS_TOTAL
Definition progress.h:195
#define PROGRESS_DATACHECKSUMS_PHASE_WAITING_TEMPREL
Definition progress.h:203
#define PROGRESS_DATACHECKSUMS_RELS_DONE
Definition progress.h:196
DataChecksumsWorkerResult success
Definition pg_list.h:54
Definition type.h:97
#define WL_TIMEOUT
#define WL_EXIT_ON_PM_DEATH
#define WL_LATCH_SET

References abort_requested, arg, B_DATACHECKSUMSWORKER_WORKER, BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerUnblockSignals(), BAS_VACUUM, BGWORKER_BYPASS_ALLOWCONN, BuildRelationList(), CHECK_FOR_ABORT_REQUEST, CHECK_FOR_INTERRUPTS, DataChecksumsStateStruct::cost_delay, DataChecksumsStateStruct::cost_limit, DataChecksumState, DATACHECKSUMSWORKER_ABORTED, DATACHECKSUMSWORKER_SUCCESSFUL, DatumGetObjectId(), DEBUG1, die, ENABLE_DATACHECKSUMS, ereport, errmsg, fb(), foreach_oid, FreeAccessStrategy(), GetAccessStrategy(), init_ps_display(), INJECTION_POINT_CACHED, InvalidOid, IS_INJECTION_POINT_ATTACHED, DataChecksumsStateStruct::launch_cost_delay, DataChecksumsStateStruct::launch_cost_limit, list_free(), list_length(), list_member_oid(), LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyBackendType, MyLatch, NIL, operation, pgstat_progress_end_command(), pgstat_progress_start_command(), pgstat_progress_update_multi_param(), pgstat_progress_update_param(), pgstat_report_activity(), pqsignal, DataChecksumsStateStruct::process_shared_catalogs, ProcessSingleRelationByOid(), procsignal_sigusr1_handler(), PROGRESS_COMMAND_DATACHECKSUMS, PROGRESS_DATACHECKSUMS_PHASE, PROGRESS_DATACHECKSUMS_PHASE_WAITING_TEMPREL, PROGRESS_DATACHECKSUMS_RELS_DONE, PROGRESS_DATACHECKSUMS_RELS_TOTAL, ResetLatch(), SIGUSR1, snprintf, STATE_RUNNING, DataChecksumsStateStruct::success, VacuumCostBalance, VacuumCostDelay, VacuumCostLimit, VacuumUpdateCosts(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, and WL_TIMEOUT.

◆ EmitAndWaitDataChecksumsBarrier()

void EmitAndWaitDataChecksumsBarrier ( uint32  state)

◆ StartDataChecksumsWorkerLauncher()

void StartDataChecksumsWorkerLauncher ( DataChecksumsWorkerOperation  op,
int  cost_delay,
int  cost_limit 
)

Definition at line 569 of file datachecksum_state.c.

572{
575 bool running;
576
577#ifdef USE_ASSERT_CHECKING
578 /* The cost delay settings have no effect when disabling */
579 if (op == DISABLE_DATACHECKSUMS)
580 Assert(cost_delay == 0 && cost_limit == 0);
581#endif
582
583 INJECTION_POINT("datachecksumsworker-startup-delay", NULL);
584
585 /* Store the desired state in shared memory */
587
591
592 /* Is the launcher already running? If so, what is it doing? */
594
596
597 /*
598 * Launch a new launcher process, if it's not running already.
599 *
600 * If the launcher is currently busy enabling the checksums, and we want
601 * them disabled (or vice versa), the launcher will notice that at latest
602 * when it's about to exit, and will loop back process the new request. So
603 * if the launcher is already running, we don't need to do anything more
604 * here to abort it.
605 *
606 * If you call pg_enable/disable_data_checksums() twice in a row, before
607 * the launcher has had a chance to start up, we still end up launching it
608 * twice. That's OK, the second invocation will see that a launcher is
609 * already running and exit quickly.
610 */
611 if (!running)
612 {
613 if ((op == ENABLE_DATACHECKSUMS && DataChecksumsOn()) ||
615 {
616 ereport(LOG,
617 errmsg("data checksums already in desired state, exiting"));
618 return;
619 }
620
621 /*
622 * Prepare the BackgroundWorker and launch it.
623 */
624 memset(&bgw, 0, sizeof(bgw));
626 bgw.bgw_start_time = BgWorkerStart_RecoveryFinished;
627 snprintf(bgw.bgw_library_name, BGW_MAXLEN, "postgres");
628 snprintf(bgw.bgw_function_name, BGW_MAXLEN, "DataChecksumsWorkerLauncherMain");
629 snprintf(bgw.bgw_name, BGW_MAXLEN, "datachecksum launcher");
630 snprintf(bgw.bgw_type, BGW_MAXLEN, "datachecksum launcher");
631 bgw.bgw_restart_time = BGW_NEVER_RESTART;
632 bgw.bgw_notify_pid = MyProcPid;
633 bgw.bgw_main_arg = (Datum) 0;
634
638 errmsg("failed to start background worker to process data checksums"));
639 }
640 else
641 {
642 ereport(LOG,
643 errmsg("data checksum processing already running"));
644 }
645}
bool RegisterDynamicBackgroundWorker(BackgroundWorker *worker, BackgroundWorkerHandle **handle)
Definition bgworker.c:1068
#define BGW_NEVER_RESTART
Definition bgworker.h:92
@ BgWorkerStart_RecoveryFinished
Definition bgworker.h:88
#define BGWORKER_BACKEND_DATABASE_CONNECTION
Definition bgworker.h:60
#define BGWORKER_SHMEM_ACCESS
Definition bgworker.h:53
#define BGW_MAXLEN
Definition bgworker.h:93
int MyProcPid
Definition globals.c:49
uint64_t Datum
Definition postgres.h:70
bool DataChecksumsOn(void)
Definition xlog.c:4695
bool DataChecksumsOff(void)
Definition xlog.c:4683

References Assert, BGW_MAXLEN, BGW_NEVER_RESTART, BGWORKER_BACKEND_DATABASE_CONNECTION, BGWORKER_SHMEM_ACCESS, BgWorkerStart_RecoveryFinished, DataChecksumsOff(), DataChecksumsOn(), DataChecksumState, DISABLE_DATACHECKSUMS, ENABLE_DATACHECKSUMS, ereport, errcode(), errmsg, ERROR, fb(), INJECTION_POINT, DataChecksumsStateStruct::launch_cost_delay, DataChecksumsStateStruct::launch_cost_limit, DataChecksumsStateStruct::launch_operation, DataChecksumsStateStruct::launcher_running, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProcPid, RegisterDynamicBackgroundWorker(), and snprintf.

Referenced by disable_data_checksums(), and enable_data_checksums().