diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-07-03 20:43:58 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-07-03 20:43:58 +0000 |
| commit | e76c1a0f4d2127f11c72c02b3d73a5dcb4517173 (patch) | |
| tree | 7a81ef438a2ef591dda9f8cf1c9e4eecfc5082e7 /src/include/storage/standby.h | |
| parent | e6a7416e28bacef6311be20375c8498b23faeb65 (diff) | |
| download | postgresql-e76c1a0f4d2127f11c72c02b3d73a5dcb4517173.tar.gz | |
Replace max_standby_delay with two parameters, max_standby_archive_delay and
max_standby_streaming_delay, and revise the implementation to avoid assuming
that timestamps found in WAL records can meaningfully be compared to clock
time on the standby server. Instead, the delay limits are compared to the
elapsed time since we last obtained a new WAL segment from archive or since
we were last "caught up" to WAL data arriving via streaming replication.
This avoids problems with clock skew between primary and standby, as well
as other corner cases that the original coding would misbehave in, such
as the primary server having significant idle time between transactions.
Per my complaint some time ago and considerable ensuing discussion.
Do some desultory editing on the hot standby documentation, too.
Diffstat (limited to 'src/include/storage/standby.h')
| -rw-r--r-- | src/include/storage/standby.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h index 9159301a16..0654c5bccc 100644 --- a/src/include/storage/standby.h +++ b/src/include/storage/standby.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.10 2010/05/13 11:15:38 sriggs Exp $ + * $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.11 2010/07/03 20:43:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +19,10 @@ #include "storage/procsignal.h" #include "storage/relfilenode.h" +/* User-settable GUC parameters */ extern int vacuum_defer_cleanup_age; +extern int max_standby_archive_delay; +extern int max_standby_streaming_delay; extern void InitRecoveryTransactionEnvironment(void); extern void ShutdownRecoveryTransactionEnvironment(void); @@ -83,7 +86,7 @@ extern void standby_desc(StringInfo buf, uint8 xl_info, char *rec); /* * Declarations for GetRunningTransactionData(). Similar to Snapshots, but * not quite. This has nothing at all to do with visibility on this server, - * so this is completely separate from snapmgr.c and snapmgr.h + * so this is completely separate from snapmgr.c and snapmgr.h. * This data is important for creating the initial snapshot state on a * standby server. We need lots more information than a normal snapshot, * hence we use a specific data structure for our needs. This data |
