|
25 | 25 | #include"access/xlogutils.h"
|
26 | 26 | #include"miscadmin.h"
|
27 | 27 | #include"pgstat.h"
|
| 28 | +#include"storage/fd.h" |
28 | 29 | #include"storage/smgr.h"
|
29 | 30 | #include"utils/guc.h"
|
30 | 31 | #include"utils/hsearch.h"
|
|
34 | 35 | /* GUC variable */
|
35 | 36 | boolignore_invalid_pages= false;
|
36 | 37 |
|
| 38 | +/* |
| 39 | + * Are we doing recovery from XLOG? |
| 40 | + * |
| 41 | + * This is only ever true in the startup process; it should be read as meaning |
| 42 | + * "this process is replaying WAL records", rather than "the system is in |
| 43 | + * recovery mode". It should be examined primarily by functions that need |
| 44 | + * to act differently when called from a WAL redo function (e.g., to skip WAL |
| 45 | + * logging). To check whether the system is in recovery regardless of which |
| 46 | + * process you're running in, use RecoveryInProgress() but only after shared |
| 47 | + * memory startup and lock initialization. |
| 48 | + * |
| 49 | + * This is updated from xlog.c, but lives here because it's mostly read by |
| 50 | + * WAL redo functions. |
| 51 | + */ |
| 52 | +boolInRecovery= false; |
| 53 | + |
| 54 | +/* Are we in Hot Standby mode? Only valid in startup process, see xlogutils.h */ |
| 55 | +HotStandbyStatestandbyState=STANDBY_DISABLED; |
| 56 | + |
37 | 57 | /*
|
38 | 58 | * During XLOG replay, we may see XLOG records for incremental updates of
|
39 | 59 | * pages that no longer exist, because their relation was later dropped or
|
|