Per gripe from Fujii Masao, though this is not exactly his proposed patch.
Categorize as DEVELOPER_OPTIONS and set context PGC_SIGHUP, as per Fujii,
but set the default to LOG because higher values aren't really sensible
(see the code for trace_recovery()). Fix the documentation to agree with
the code and to try to explain what the variable actually does. Get rid
of no-op calls trace_recovery(LOG), which accomplish nothing except to
demonstrate that this option confuses even its author.
-
+
Server Configuration
+
+ trace_recovery_messages (enum)
+
+
trace_recovery_messages> configuration parameter
+
+
+ Enables logging of recovery-related debugging output that otherwise
+ would not be logged. This parameter allows the user to override the
+ normal setting of , but only for
+ specific messages. This is intended for use in debugging Hot Standby.
+ Valid values are DEBUG5>, DEBUG4>,
+ DEBUG3>, DEBUG2>, DEBUG1>, and
+ LOG>. The default, LOG>, does not affect
+ logging decisions at all. The other values cause recovery-related
+ debug messages of that priority or higher to be logged as though they
+ had LOG> priority; for common settings of
+ log_min_messages> this results in unconditionally sending
+ them to the server log.
+ This parameter can only be set in the postgresql.conf>
+ file or on the server command line.
+
+
+
+
trace_sort (boolean)
-
- trace_recovery_messages (enum)
-
-
trace_recovery_messages> configuration parameter
-
-
- Controls which message levels are written to the server log
- for system modules needed for recovery processing. This allows
- the user to override the normal setting of log_min_messages,
- but only for specific messages. This is intended for use in
- debugging Hot Standby.
- Valid values are DEBUG5>, DEBUG4>,
- DEBUG3>, DEBUG2>, DEBUG1>,
- INFO>, NOTICE>, WARNING>,
- ERROR>, LOG>, FATAL>, and
- PANIC>. Each level includes all the levels that
- follow it. The later the level, the fewer messages are sent
- to the log. The default is WARNING>. Note that
- LOG> has a different rank here than in
- client_min_messages>.
- Parameter should be set in postgresql.conf only.
-
-
-
-
zero_damaged_pages (boolean)
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.28 2010/08/12 23:24:54 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.29 2010/08/19 22:55:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
lock->xid, lock->dbOid, lock->relOid);
SET_LOCKTAG_RELATION(locktag, lock->dbOid, lock->relOid);
if (!LockRelease(&locktag, AccessExclusiveLock, true))
- elog(trace_recovery(LOG),
+ elog(LOG,
"RecoveryLockList contains entry for lock no longer recorded by lock manager: xid %u database %u relation %u",
lock->xid, lock->dbOid, lock->relOid);
lock->xid, lock->dbOid, lock->relOid);
SET_LOCKTAG_RELATION(locktag, lock->dbOid, lock->relOid);
if (!LockRelease(&locktag, AccessExclusiveLock, true))
- elog(trace_recovery(LOG),
+ elog(LOG,
"RecoveryLockList contains entry for lock no longer recorded by lock manager: xid %u database %u relation %u",
lock->xid, lock->dbOid, lock->relOid);
RecoveryLockList = list_delete_cell(RecoveryLockList, cell, prev);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.225 2010/07/18 23:43:32 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.226 2010/08/19 22:55:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
/*
- * If trace_recovery_messages is set to make this visible, then show as LOG,
- * else display as whatever level is set. It may still be shown, but only
- * if log_min_messages is set lower than trace_recovery_messages.
+ * Adjust the level of a recovery-related message per trace_recovery_messages.
+ *
+ * The argument is the default log level of the message, eg, DEBUG2. (This
+ * should only be applied to DEBUGn log messages, otherwise it's a no-op.)
+ * If the level is >= trace_recovery_messages, we return LOG, causing the
+ * message to be logged unconditionally (for most settings of
+ * log_min_messages). Otherwise, we return the argument unchanged.
+ * The message will then be shown based on the setting of log_min_messages.
*
* Intention is to keep this for at least the whole of the 9.0 production
* release, so we can more easily diagnose production problems in the field.
+ * It should go away eventually, though, because it's an ugly and
+ * hard-to-explain kluge.
*/
int
trace_recovery(int trace_level)
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.567 2010/08/13 20:10:53 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.568 2010/08/19 22:55:01 tgl Exp $
*
*--------------------------------------------------------------------
*/
},
{
- {"trace_recovery_messages", PGC_SUSET, LOGGING_WHEN,
- gettext_noop("Sets the message levels that are logged during recovery."),
+ {"trace_recovery_messages", PGC_SIGHUP, DEVELOPER_OPTIONS,
+ gettext_noop("Enables logging of recovery-related debugging information."),
gettext_noop("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
},
&trace_recovery_messages,
- DEBUG1, server_message_level_options, NULL, NULL
+ /*
+ * client_message_level_options allows too many values, really,
+ * but it's not worth having a separate options array for this.
+ */
+ LOG, client_message_level_options, NULL, NULL
},
{