Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Re: odd output ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 24 of 24 Topic 9349 of 11009
Post > Topic >>

Re: odd output in restore mode

by bruce@[EMAIL PROTECTED] (Bruce Momjian) Jun 30, 2008 at 06:11 PM

--ELM1214863862-4739-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"

Andrew Dunstan wrote:
> 
> I have just been working on setting up a continuous recovery failover 
> system, and noticed some odd log lines, shown below. (Using 8.3).
> 
> First note that our parsing of recovery.conf in xlog.c is pretty bad, 
> and at least we need to do***ent the quirks if it's not going to be 
> fixed. log_restartpoints is said to be boolean, but when I set it to an 
> unquoted true I got a fatal error, while a quoted 'on' sets it to false,

> as seen. Ick. What is more, I apparently managed to get the recovery 

I have fixed the boolean problem with the attached, applied patch.  It
exposes guc.c::parse_bool() for use in xlog.c.

I assume all the other problems you re****ted have been corrected.

-- 
  Bruce Momjian  <bruce@[EMAIL PROTECTED]
>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

--ELM1214863862-4739-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/x-diff
Content-Disposition: inline; filename="/rtmp/diff"

Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.314
diff -c -c -r1.314 xlog.c
*** src/backend/access/transam/xlog.c	12 Jun 2008 09:12:30 -0000	1.314
--- src/backend/access/transam/xlog.c	30 Jun 2008 22:10:07 -0000
***************
*** 4523,4535 ****
  			/*
  			 * does nothing if a recovery_target is not also set
  			 */
! 			if (strcmp(tok2, "true") == 0)
! 				recoveryTargetInclusive = true;
! 			else
! 			{
! 				recoveryTargetInclusive = false;
! 				tok2 = "false";
! 			}
  			ere****t(LOG,
  					(errmsg("recovery_target_inclusive = %s", tok2)));
  		}
--- 4523,4532 ----
  			/*
  			 * does nothing if a recovery_target is not also set
  			 */
! 			if (!parse_bool(tok2, &recoveryTargetInclusive))
! 				  ere****t(ERROR,
! 							(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
! 					  errmsg("parameter \"recovery_target_inclusive\" requires a
Boolean value")));
  			ere****t(LOG,
  					(errmsg("recovery_target_inclusive = %s", tok2)));
  		}
***************
*** 4538,4550 ****
  			/*
  			 * does nothing if a recovery_target is not also set
  			 */
! 			if (strcmp(tok2, "true") == 0)
! 				recoveryLogRestartpoints = true;
! 			else
! 			{
! 				recoveryLogRestartpoints = false;
! 				tok2 = "false";
! 			}
  			ere****t(LOG,
  					(errmsg("log_restartpoints = %s", tok2)));
  		}
--- 4535,4544 ----
  			/*
  			 * does nothing if a recovery_target is not also set
  			 */
! 			if (!parse_bool(tok2, &recoveryLogRestartpoints))
! 				  ere****t(ERROR,
! 							(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
! 					  errmsg("parameter \"log_restartpoints\" requires a Boolean
value")));
  			ere****t(LOG,
  					(errmsg("log_restartpoints = %s", tok2)));
  		}
Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v
retrieving revision 1.457
diff -c -c -r1.457 guc.c
*** src/backend/utils/misc/guc.c	30 Jun 2008 10:58:47 -0000	1.457
--- src/backend/utils/misc/guc.c	30 Jun 2008 22:10:07 -0000
***************
*** 3991,3997 ****
   * If the string parses okay, return true, else false.
   * If okay and result is not NULL, return the value in *result.
   */
! static bool
  parse_bool(const char *value, bool *result)
  {
  	size_t		len = strlen(value);
--- 3991,3997 ----
   * If the string parses okay, return true, else false.
   * If okay and result is not NULL, return the value in *result.
   */
! bool
  parse_bool(const char *value, bool *result)
  {
  	size_t		len = strlen(value);
Index: src/include/utils/guc.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/utils/guc.h,v
retrieving revision 1.96
diff -c -c -r1.96 guc.h
*** src/include/utils/guc.h	28 May 2008 09:04:06 -0000	1.96
--- src/include/utils/guc.h	30 Jun 2008 22:10:07 -0000
***************
*** 223,228 ****
--- 223,229 ----
  extern void AtEOXact_GUC(bool isCommit, int nestLevel);
  extern void BeginRe****tingGUCOptions(void);
  extern void ParseLongOption(const char *string, char **name, char
**value);
+ extern bool parse_bool(const char *value, bool *result);
  extern bool set_config_option(const char *name, const char *value,
  				  GucContext context, GucSource source,
  				  GucAction action, bool changeVal);

--ELM1214863862-4739-0_
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

--ELM1214863862-4739-0_--
 




 24 Posts in Topic:
odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-12 16:57:01 
Re: odd output in restore mode
simon@[EMAIL PROTECTED]   2008-05-12 23:14:00 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-12 18:58:37 
Re: odd output in restore mode
dpage@[EMAIL PROTECTED]   2008-05-18 22:16:17 
Re: odd output in restore mode
bruce@[EMAIL PROTECTED]   2008-06-30 18:13:12 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-06-30 19:29:03 
Re: odd output in restore mode
simon@[EMAIL PROTECTED]   2008-05-13 00:37:53 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-12 21:15:55 
Re: odd output in restore mode
tgl@[EMAIL PROTECTED] (T  2008-05-12 21:38:58 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-12 23:03:25 
Re: odd output in restore mode
dpage@[EMAIL PROTECTED]   2008-05-13 17:15:12 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-18 08:38:12 
Re: odd output in restore mode
xzilla@[EMAIL PROTECTED]   2008-05-12 21:06:26 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-12 22:40:38 
Re: odd output in restore mode
simon@[EMAIL PROTECTED]   2008-05-13 06:44:35 
Re: odd output in restore mode
simon@[EMAIL PROTECTED]   2008-05-13 06:37:24 
Re: odd output in restore mode
dpage@[EMAIL PROTECTED]   2008-05-13 08:42:26 
Re: odd output in restore mode
simon@[EMAIL PROTECTED]   2008-05-13 09:32:55 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-13 08:00:29 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-13 08:26:35 
Re: odd output in restore mode
alvherre@[EMAIL PROTECTED  2008-05-13 11:08:52 
Re: odd output in restore mode
andrew@[EMAIL PROTECTED]   2008-05-13 12:05:58 
Re: odd output in restore mode
alvherre@[EMAIL PROTECTED  2008-05-13 12:11:30 
Re: odd output in restore mode
bruce@[EMAIL PROTECTED]   2008-06-30 18:11:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 8:33:27 CST 2008.