@@ -37,15 +37,16 @@ get_control_data(ClusterInfo *cluster, bool live_check)
37
37
char bufin [MAX_STRING ];
38
38
FILE * output ;
39
39
char * p ;
40
+ bool got_tli = false;
41
+ bool got_log_id = false;
42
+ bool got_log_seg = false;
40
43
bool got_xid = false;
41
44
bool got_oid = false;
42
- bool got_nextxlogfile = false;
43
45
bool got_multi = false;
44
- bool got_mxoff = false;
45
46
bool got_oldestmulti = false;
46
- bool got_log_id = false;
47
- bool got_log_seg = false;
48
- bool got_tli = false;
47
+ bool got_mxoff = false;
48
+ bool got_nextxlogfile = false;
49
+ bool got_float8_pass_by_value = false;
49
50
bool got_align = false;
50
51
bool got_blocksz = false;
51
52
bool got_largesz = false;
@@ -56,7 +57,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
56
57
bool got_toast = false;
57
58
bool got_large_object = false;
58
59
bool got_date_is_int = false;
59
- bool got_float8_pass_by_value = false;
60
60
bool got_data_checksum_version = false;
61
61
char * lc_collate = NULL ;
62
62
char * lc_ctype = NULL ;
@@ -67,9 +67,9 @@ get_control_data(ClusterInfo *cluster, bool live_check)
67
67
char * language = NULL ;
68
68
char * lc_all = NULL ;
69
69
char * lc_messages = NULL ;
70
+ uint32 tli = 0 ;
70
71
uint32 logid = 0 ;
71
72
uint32 segno = 0 ;
72
- uint32 tli = 0 ;
73
73
74
74
75
75
/*
@@ -154,38 +154,38 @@ get_control_data(ClusterInfo *cluster, bool live_check)
154
154
p ++ ; /* remove ':' char */
155
155
cluster -> controldata .cat_ver = str2uint (p );
156
156
}
157
- else if ((p = strstr (bufin , "First log file ID after reset :" )) != NULL )
157
+ else if ((p = strstr (bufin , "Latest checkpoint's TimeLineID :" )) != NULL )
158
158
{
159
159
p = strchr (p , ':' );
160
160
161
161
if (p == NULL || strlen (p ) <= 1 )
162
162
pg_fatal ("%d: controldata retrieval problem\n" , __LINE__ );
163
163
164
164
p ++ ; /* remove ':' char */
165
- logid = str2uint (p );
166
- got_log_id = true;
165
+ tli = str2uint (p );
166
+ got_tli = true;
167
167
}
168
- else if ((p = strstr (bufin , "First log file segment after reset:" )) != NULL )
168
+ else if ((p = strstr (bufin , "First log file ID after reset:" )) != NULL )
169
169
{
170
170
p = strchr (p , ':' );
171
171
172
172
if (p == NULL || strlen (p ) <= 1 )
173
173
pg_fatal ("%d: controldata retrieval problem\n" , __LINE__ );
174
174
175
175
p ++ ; /* remove ':' char */
176
- segno = str2uint (p );
177
- got_log_seg = true;
176
+ logid = str2uint (p );
177
+ got_log_id = true;
178
178
}
179
- else if ((p = strstr (bufin , "Latest checkpoint's TimeLineID :" )) != NULL )
179
+ else if ((p = strstr (bufin , "First log file segment after reset :" )) != NULL )
180
180
{
181
181
p = strchr (p , ':' );
182
182
183
183
if (p == NULL || strlen (p ) <= 1 )
184
184
pg_fatal ("%d: controldata retrieval problem\n" , __LINE__ );
185
185
186
186
p ++ ; /* remove ':' char */
187
- tli = str2uint (p );
188
- got_tli = true;
187
+ segno = str2uint (p );
188
+ got_log_seg = true;
189
189
}
190
190
else if ((p = strstr (bufin , "Latest checkpoint's NextXID:" )) != NULL )
191
191
{
@@ -266,6 +266,18 @@ get_control_data(ClusterInfo *cluster, bool live_check)
266
266
strlcpy (cluster -> controldata .nextxlogfile , p , 25 );
267
267
got_nextxlogfile = true;
268
268
}
269
+ else if ((p = strstr (bufin , "Float8 argument passing:" )) != NULL )
270
+ {
271
+ p = strchr (p , ':' );
272
+
273
+ if (p == NULL || strlen (p ) <= 1 )
274
+ pg_fatal ("%d: controldata retrieval problem\n" , __LINE__ );
275
+
276
+ p ++ ; /* remove ':' char */
277
+ /* used later for contrib check */
278
+ cluster -> controldata .float8_pass_by_value = strstr (p , "by value" ) != NULL ;
279
+ got_float8_pass_by_value = true;
280
+ }
269
281
else if ((p = strstr (bufin , "Maximum data alignment:" )) != NULL )
270
282
{
271
283
p = strchr (p , ':' );
@@ -376,18 +388,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
376
388
cluster -> controldata .date_is_int = strstr (p , "64-bit integers" ) != NULL ;
377
389
got_date_is_int = true;
378
390
}
379
- else if ((p = strstr (bufin , "Float8 argument passing:" )) != NULL )
380
- {
381
- p = strchr (p , ':' );
382
-
383
- if (p == NULL || strlen (p ) <= 1 )
384
- pg_fatal ("%d: controldata retrieval problem\n" , __LINE__ );
385
-
386
- p ++ ; /* remove ':' char */
387
- /* used later for contrib check */
388
- cluster -> controldata .float8_pass_by_value = strstr (p , "by value" ) != NULL ;
389
- got_float8_pass_by_value = true;
390
- }
391
391
else if ((p = strstr (bufin , "checksum" )) != NULL )
392
392
{
393
393
p = strchr (p , ':' );
@@ -449,11 +449,12 @@ get_control_data(ClusterInfo *cluster, bool live_check)
449
449
(!got_oldestmulti &&
450
450
cluster -> controldata .cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER ) ||
451
451
!got_mxoff || (!live_check && !got_nextxlogfile ) ||
452
- !got_align || !got_blocksz || !got_largesz || !got_walsz ||
453
- !got_walseg || !got_ident || !got_index || !got_toast ||
452
+ !got_float8_pass_by_value || !got_align || !got_blocksz ||
453
+ !got_largesz || !got_walsz || !got_walseg || !got_ident ||
454
+ !got_index || !got_toast ||
454
455
(!got_large_object &&
455
456
cluster -> controldata .ctrl_ver >= LARGE_OBJECT_SIZE_PG_CONTROL_VER ) ||
456
- !got_date_is_int || !got_float8_pass_by_value || ! got_data_checksum_version )
457
+ !got_date_is_int || !got_data_checksum_version )
457
458
{
458
459
pg_log (PG_REPORT ,
459
460
"The %s cluster lacks some required control information:\n" ,
@@ -478,6 +479,9 @@ get_control_data(ClusterInfo *cluster, bool live_check)
478
479
if (!live_check && !got_nextxlogfile )
479
480
pg_log (PG_REPORT , " first WAL segment after reset\n" );
480
481
482
+ if (!got_float8_pass_by_value )
483
+ pg_log (PG_REPORT , " float8 argument passing method\n" );
484
+
481
485
if (!got_align )
482
486
pg_log (PG_REPORT , " maximum alignment\n" );
483
487
@@ -509,9 +513,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
509
513
if (!got_date_is_int )
510
514
pg_log (PG_REPORT , " dates/times are integers?\n" );
511
515
512
- if (!got_float8_pass_by_value )
513
- pg_log (PG_REPORT , " float8 argument passing method\n" );
514
-
515
516
/* value added in Postgres 9.3 */
516
517
if (!got_data_checksum_version )
517
518
pg_log (PG_REPORT , " data checksum version\n" );
@@ -563,7 +564,10 @@ check_control_data(ControlData *oldctrl,
563
564
if (oldctrl -> date_is_int != newctrl -> date_is_int )
564
565
pg_fatal ("old and new pg_controldata date/time storage types do not match\n" );
565
566
566
- /* float8_pass_by_value does not need to match */
567
+ /*
568
+ * float8_pass_by_value does not need to match, but is used in
569
+ * check_for_isn_and_int8_passing_mismatch().
570
+ */
567
571
568
572
/*
569
573
* We might eventually allow upgrades from checksum to no-checksum
0 commit comments