Fix pg_upgrade for 9.3 with data checksums.

Previous changes misconstrued pg_upgrade internals
causing build farm breakages.
This commit is contained in:
Simon Riggs 2013-04-30 15:49:24 +01:00
parent be475a2473
commit 87d3b35a1c
2 changed files with 12 additions and 12 deletions

View File

@ -56,7 +56,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
bool got_toast = false;
bool got_date_is_int = false;
bool got_float8_pass_by_value = false;
bool got_data_checksums = false;
bool got_data_checksum_version = false;
char *lc_collate = NULL;
char *lc_ctype = NULL;
char *lc_monetary = NULL;
@ -135,8 +135,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
/* Only in <= 9.2 */
if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
{
cluster->controldata.data_checksums = false;
got_data_checksums = true;
cluster->controldata.data_checksum_version = 0;
got_data_checksum_version = true;
}
/* we have the result of cmd in "output". so parse it line by line now */
@ -401,7 +401,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
cluster->controldata.float8_pass_by_value = strstr(p, "by value") != NULL;
got_float8_pass_by_value = true;
}
else if ((p = strstr(bufin, "checksums")) != NULL)
else if ((p = strstr(bufin, "checksum")) != NULL)
{
p = strchr(p, ':');
@ -410,8 +410,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
p++; /* removing ':' char */
/* used later for contrib check */
cluster->controldata.data_checksums = strstr(p, "enabled") != NULL;
got_data_checksums = true;
cluster->controldata.data_checksum_version = str2uint(p);
got_data_checksum_version = true;
}
/* In pre-8.4 only */
else if ((p = strstr(bufin, "LC_COLLATE:")) != NULL)
@ -496,7 +496,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
!got_tli ||
!got_align || !got_blocksz || !got_largesz || !got_walsz ||
!got_walseg || !got_ident || !got_index || !got_toast ||
!got_date_is_int || !got_float8_pass_by_value || !got_data_checksums)
!got_date_is_int || !got_float8_pass_by_value || !got_data_checksum_version)
{
pg_log(PG_REPORT,
"The %s cluster lacks some required control information:\n",
@ -556,8 +556,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
pg_log(PG_REPORT, " float8 argument passing method\n");
/* value added in Postgres 9.3 */
if (!got_data_checksums)
pg_log(PG_REPORT, " data checksums\n");
if (!got_data_checksum_version)
pg_log(PG_REPORT, " data checksum version\n");
pg_log(PG_FATAL,
"Cannot continue without required control information, terminating\n");
@ -622,10 +622,10 @@ check_control_data(ControlData *oldctrl,
}
/* We might eventually allow upgrades from checksum to no-checksum clusters. */
if (oldctrl->data_checksums != newctrl->data_checksums)
if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
{
pg_log(PG_FATAL,
"old and new pg_controldata checksums settings are invalid or do not match\n");
"old and new pg_controldata checksum versions are invalid or do not match\n");
}
}

View File

@ -202,7 +202,7 @@ typedef struct
uint32 toast;
bool date_is_int;
bool float8_pass_by_value;
bool data_checksums;
bool data_checksum_version;
char *lc_collate;
char *lc_ctype;
char *encoding;