pgpool2.git / summary / log / commit / refs

commit    cc33fe3fd10493f16a481c622bfab53458b57d06
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sat Sep 24 01:42:12 2016 +0000

    Change the default value of search_primary_node_timeout from 10 to 300.
    
    Prior default value 10 seconds is sometimes too short for a standby to
    be promoted.
    
    Per [pgpool-general: 5026].


doc/pgpool-en.html | 2 +- doc/pgpool-ja.html | 2 +- src/config/pool_config_variables.c | 2 +- src/parser/scan.c | 68 +++++++++++++++++------------- src/sample/pgpool.conf.sample | 2 +- src/sample/pgpool.conf.sample-master-slave | 2 +- src/sample/pgpool.conf.sample-replication | 2 +- src/sample/pgpool.conf.sample-stream | 2 +- 8 files changed, 45 insertions(+), 37 deletions(-) diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html index be57cec5a..a5cdc8beb 100644 --- a/doc/pgpool-en.html +++ b/doc/pgpool-en.html @@ -1075,7 +1075,7 @@ local0.* /var/log/pgpool.log <dd> <p>The parameter specifies the maximum amount of time in seconds to search for a primary node when a failover scenario occurs. - The default value for the parameter is 10. + The default value for the parameter is 300. pgpool-II will search for the primary node for the amount of time given in case of failover before giving up trying to search for a primary node. 0 means keep trying forever. diff --git a/doc/pgpool-ja.html b/doc/pgpool-ja.html index 69e047551..d509cb108 100644 --- a/doc/pgpool-ja.html +++ b/doc/pgpool-ja.html @@ -1125,7 +1125,7 @@ local0.* /var/log/pgpool.log <dt><a name="SEARCH_PRIMARY_NODE_TIMEOUT"></a>search_primary_node_timeout <span class="version">V3.3 -</span></dt> <dd> <p>このパラメータはフェイルオーバが起きた時にプライマリノードを検索する際のタイムアウト時間を秒単位で指定します。 - デフォルト値は10です。 + デフォルト値は300です。 pgpool-IIは、フェイルオーバの際にここで指定した時間プライマリノードを検索し続けます。 0を指定すると、永久に検索し続けます。 このパラメータはストリーミングレプリケーションモードで運用している場合以外は無視されます。 diff --git a/src/config/pool_config_variables.c b/src/config/pool_config_variables.c index 4dcdb7595..e68932181 100644 --- a/src/config/pool_config_variables.c +++ b/src/config/pool_config_variables.c @@ -1417,7 +1417,7 @@ static struct config_int ConfigureNamesInt[] = CONFIG_VAR_TYPE_INT,false, 0 }, &g_pool_config.search_primary_node_timeout, - 10, + 300, 0,INT_MAX, NULL, NULL, NULL }, diff --git a/src/parser/scan.c b/src/parser/scan.c index fa356dcd1..a1f95be31 100644 --- a/src/parser/scan.c +++ b/src/parser/scan.c @@ -57,7 +57,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -207,7 +207,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -219,11 +227,6 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -246,6 +249,11 @@ typedef size_t yy_size_t; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -263,7 +271,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -342,7 +350,7 @@ static void core_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanne YY_BUFFER_STATE core_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE core_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE core_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE core_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); void *core_yyalloc (yy_size_t ,yyscan_t yyscanner ); void *core_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -374,7 +382,7 @@ void core_yyfree (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define core_yywrap(yyscanner) 1 +#define core_yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -1081,7 +1089,7 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner); * Note that xcstart must appear before operator, as explained above! * Also whitespace (comment) must appear before operator. */ -#line 1085 "scan.c" +#line 1093 "scan.c" #define INITIAL 0 #define xb 1 @@ -1122,8 +1130,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; + int yy_n_chars; + int yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -1180,7 +1188,7 @@ FILE *core_yyget_out (yyscan_t yyscanner ); void core_yyset_out (FILE * out_str ,yyscan_t yyscanner ); -yy_size_t core_yyget_leng (yyscan_t yyscanner ); +int core_yyget_leng (yyscan_t yyscanner ); char *core_yyget_text (yyscan_t yyscanner ); @@ -1188,10 +1196,6 @@ int core_yyget_lineno (yyscan_t yyscanner ); void core_yyset_lineno (int line_number ,yyscan_t yyscanner ); -int core_yyget_column (yyscan_t yyscanner ); - -void core_yyset_column (int column_no ,yyscan_t yyscanner ); - YYSTYPE * core_yyget_lval (yyscan_t yyscanner ); void core_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -1232,7 +1236,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1339,7 +1348,7 @@ YY_DECL #line 398 "scan.l" -#line 1343 "scan.c" +#line 1352 "scan.c" yylval = yylval_param; @@ -2362,7 +2371,7 @@ YY_RULE_SETUP #line 1020 "scan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2366 "scan.c" +#line 2375 "scan.c" case YY_END_OF_BUFFER: { @@ -2548,21 +2557,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2593,7 +2602,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); + yyg->yy_n_chars, (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -2690,7 +2699,6 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 289); - (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -2719,7 +2727,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2999,7 +3007,7 @@ void core_yypop_buffer_state (yyscan_t yyscanner) */ static void core_yyensure_buffer_stack (yyscan_t yyscanner) { - yy_size_t num_to_alloc; + int num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -3097,7 +3105,7 @@ YY_BUFFER_STATE core_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE core_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE core_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -3212,7 +3220,7 @@ FILE *core_yyget_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t core_yyget_leng (yyscan_t yyscanner) +int core_yyget_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3248,7 +3256,7 @@ void core_yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "core_yyset_lineno called with no buffer" ); + yy_fatal_error( "core_yyset_lineno called with no buffer" , yyscanner); yylineno = line_number; } @@ -3263,7 +3271,7 @@ void core_yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "core_yyset_column called with no buffer" ); + yy_fatal_error( "core_yyset_column called with no buffer" , yyscanner); yycolumn = column_no; } diff --git a/src/sample/pgpool.conf.sample b/src/sample/pgpool.conf.sample index 2b194eb92..fc7d5c8d1 100644 --- a/src/sample/pgpool.conf.sample +++ b/src/sample/pgpool.conf.sample @@ -427,7 +427,7 @@ fail_over_on_backend_error = on # If set to off, pgpool will report an # error and disconnect the session. -search_primary_node_timeout = 10 +search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching diff --git a/src/sample/pgpool.conf.sample-master-slave b/src/sample/pgpool.conf.sample-master-slave index 9f016be98..6c6d86714 100644 --- a/src/sample/pgpool.conf.sample-master-slave +++ b/src/sample/pgpool.conf.sample-master-slave @@ -426,7 +426,7 @@ fail_over_on_backend_error = on # If set to off, pgpool will report an # error and disconnect the session. -search_primary_node_timeout = 10 +search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching diff --git a/src/sample/pgpool.conf.sample-replication b/src/sample/pgpool.conf.sample-replication index 20ba0df3d..01a7d88a4 100644 --- a/src/sample/pgpool.conf.sample-replication +++ b/src/sample/pgpool.conf.sample-replication @@ -425,7 +425,7 @@ fail_over_on_backend_error = on # If set to off, pgpool will report an # error and disconnect the session. -search_primary_node_timeout = 10 +search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching diff --git a/src/sample/pgpool.conf.sample-stream b/src/sample/pgpool.conf.sample-stream index 0ec1c55ce..a5ec7b6de 100644 --- a/src/sample/pgpool.conf.sample-stream +++ b/src/sample/pgpool.conf.sample-stream @@ -426,7 +426,7 @@ fail_over_on_backend_error = on # If set to off, pgpool will report an # error and disconnect the session. -search_primary_node_timeout = 10 +search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching [parent: a7e459fa3120]