Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5a3022fd
Commit
5a3022fd
authored
May 14, 2015
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_upgrade: make controldata checks more consistent
Also add missing float8_pass_by_value check.
parent
a486e357
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
29 deletions
+27
-29
src/bin/pg_upgrade/controldata.c
src/bin/pg_upgrade/controldata.c
+27
-28
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/pg_upgrade.h
+0
-1
No files found.
src/bin/pg_upgrade/controldata.c
View file @
5a3022fd
...
@@ -154,23 +154,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -154,23 +154,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
p
++
;
/* remove ':' char */
p
++
;
/* remove ':' char */
cluster
->
controldata
.
cat_ver
=
str2uint
(
p
);
cluster
->
controldata
.
cat_ver
=
str2uint
(
p
);
}
}
else
if
((
p
=
strstr
(
bufin
,
"First log segment after reset:"
))
!=
NULL
)
{
/* Skip the colon and any whitespace after it */
p
=
strchr
(
p
,
':'
);
if
(
p
==
NULL
||
strlen
(
p
)
<=
1
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
p
=
strpbrk
(
p
,
"01234567890ABCDEF"
);
if
(
p
==
NULL
||
strlen
(
p
)
<=
1
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
/* Make sure it looks like a valid WAL file name */
if
(
strspn
(
p
,
"0123456789ABCDEF"
)
!=
24
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
strlcpy
(
cluster
->
controldata
.
nextxlogfile
,
p
,
25
);
got_nextxlogfile
=
true
;
}
else
if
((
p
=
strstr
(
bufin
,
"First log file ID after reset:"
))
!=
NULL
)
else
if
((
p
=
strstr
(
bufin
,
"First log file ID after reset:"
))
!=
NULL
)
{
{
p
=
strchr
(
p
,
':'
);
p
=
strchr
(
p
,
':'
);
...
@@ -201,7 +184,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -201,7 +184,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
p
++
;
/* remove ':' char */
p
++
;
/* remove ':' char */
cluster
->
controldata
.
chkpnt_
tli
=
str2uint
(
p
);
tli
=
str2uint
(
p
);
got_tli
=
true
;
got_tli
=
true
;
}
}
else
if
((
p
=
strstr
(
bufin
,
"Latest checkpoint's NextXID:"
))
!=
NULL
)
else
if
((
p
=
strstr
(
bufin
,
"Latest checkpoint's NextXID:"
))
!=
NULL
)
...
@@ -266,6 +249,23 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -266,6 +249,23 @@ get_control_data(ClusterInfo *cluster, bool live_check)
cluster
->
controldata
.
chkpnt_nxtmxoff
=
str2uint
(
p
);
cluster
->
controldata
.
chkpnt_nxtmxoff
=
str2uint
(
p
);
got_mxoff
=
true
;
got_mxoff
=
true
;
}
}
else
if
((
p
=
strstr
(
bufin
,
"First log segment after reset:"
))
!=
NULL
)
{
/* Skip the colon and any whitespace after it */
p
=
strchr
(
p
,
':'
);
if
(
p
==
NULL
||
strlen
(
p
)
<=
1
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
p
=
strpbrk
(
p
,
"01234567890ABCDEF"
);
if
(
p
==
NULL
||
strlen
(
p
)
<=
1
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
/* Make sure it looks like a valid WAL file name */
if
(
strspn
(
p
,
"0123456789ABCDEF"
)
!=
24
)
pg_fatal
(
"%d: controldata retrieval problem
\n
"
,
__LINE__
);
strlcpy
(
cluster
->
controldata
.
nextxlogfile
,
p
,
25
);
got_nextxlogfile
=
true
;
}
else
if
((
p
=
strstr
(
bufin
,
"Maximum data alignment:"
))
!=
NULL
)
else
if
((
p
=
strstr
(
bufin
,
"Maximum data alignment:"
))
!=
NULL
)
{
{
p
=
strchr
(
p
,
':'
);
p
=
strchr
(
p
,
':'
);
...
@@ -436,7 +436,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -436,7 +436,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
*/
*/
if
(
GET_MAJOR_VERSION
(
cluster
->
major_version
)
<=
902
)
if
(
GET_MAJOR_VERSION
(
cluster
->
major_version
)
<=
902
)
{
{
if
(
got_log_id
&&
got_log_seg
)
if
(
got_
tli
&&
got_
log_id
&&
got_log_seg
)
{
{
snprintf
(
cluster
->
controldata
.
nextxlogfile
,
25
,
"%08X%08X%08X"
,
snprintf
(
cluster
->
controldata
.
nextxlogfile
,
25
,
"%08X%08X%08X"
,
tli
,
logid
,
segno
);
tli
,
logid
,
segno
);
...
@@ -446,11 +446,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -446,11 +446,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
/* verify that we got all the mandatory pg_control data */
/* verify that we got all the mandatory pg_control data */
if
(
!
got_xid
||
!
got_oid
||
if
(
!
got_xid
||
!
got_oid
||
!
got_multi
||
!
got_mxoff
||
!
got_multi
||
(
!
got_oldestmulti
&&
(
!
got_oldestmulti
&&
cluster
->
controldata
.
cat_ver
>=
MULTIXACT_FORMATCHANGE_CAT_VER
)
||
cluster
->
controldata
.
cat_ver
>=
MULTIXACT_FORMATCHANGE_CAT_VER
)
||
(
!
live_check
&&
!
got_nextxlogfile
)
||
!
got_mxoff
||
(
!
live_check
&&
!
got_nextxlogfile
)
||
!
got_tli
||
!
got_align
||
!
got_blocksz
||
!
got_largesz
||
!
got_walsz
||
!
got_align
||
!
got_blocksz
||
!
got_largesz
||
!
got_walsz
||
!
got_walseg
||
!
got_ident
||
!
got_index
||
!
got_toast
||
!
got_walseg
||
!
got_ident
||
!
got_index
||
!
got_toast
||
(
!
got_large_object
&&
(
!
got_large_object
&&
...
@@ -470,19 +469,16 @@ get_control_data(ClusterInfo *cluster, bool live_check)
...
@@ -470,19 +469,16 @@ get_control_data(ClusterInfo *cluster, bool live_check)
if
(
!
got_multi
)
if
(
!
got_multi
)
pg_log
(
PG_REPORT
,
" latest checkpoint next MultiXactId
\n
"
);
pg_log
(
PG_REPORT
,
" latest checkpoint next MultiXactId
\n
"
);
if
(
!
got_mxoff
)
pg_log
(
PG_REPORT
,
" latest checkpoint next MultiXactOffset
\n
"
);
if
(
!
got_oldestmulti
&&
if
(
!
got_oldestmulti
&&
cluster
->
controldata
.
cat_ver
>=
MULTIXACT_FORMATCHANGE_CAT_VER
)
cluster
->
controldata
.
cat_ver
>=
MULTIXACT_FORMATCHANGE_CAT_VER
)
pg_log
(
PG_REPORT
,
" latest checkpoint oldest MultiXactId
\n
"
);
pg_log
(
PG_REPORT
,
" latest checkpoint oldest MultiXactId
\n
"
);
if
(
!
got_mxoff
)
pg_log
(
PG_REPORT
,
" latest checkpoint next MultiXactOffset
\n
"
);
if
(
!
live_check
&&
!
got_nextxlogfile
)
if
(
!
live_check
&&
!
got_nextxlogfile
)
pg_log
(
PG_REPORT
,
" first WAL segment after reset
\n
"
);
pg_log
(
PG_REPORT
,
" first WAL segment after reset
\n
"
);
if
(
!
got_tli
)
pg_log
(
PG_REPORT
,
" latest checkpoint timeline ID
\n
"
);
if
(
!
got_align
)
if
(
!
got_align
)
pg_log
(
PG_REPORT
,
" maximum alignment
\n
"
);
pg_log
(
PG_REPORT
,
" maximum alignment
\n
"
);
...
@@ -568,6 +564,9 @@ check_control_data(ControlData *oldctrl,
...
@@ -568,6 +564,9 @@ check_control_data(ControlData *oldctrl,
if
(
oldctrl
->
date_is_int
!=
newctrl
->
date_is_int
)
if
(
oldctrl
->
date_is_int
!=
newctrl
->
date_is_int
)
pg_fatal
(
"old and new pg_controldata date/time storage types do not match
\n
"
);
pg_fatal
(
"old and new pg_controldata date/time storage types do not match
\n
"
);
if
(
oldctrl
->
float8_pass_by_value
!=
newctrl
->
float8_pass_by_value
)
pg_fatal
(
"old and new pg_controldata float8 argument passing methods do not match
\n
"
);
/*
/*
* We might eventually allow upgrades from checksum to no-checksum
* We might eventually allow upgrades from checksum to no-checksum
* clusters.
* clusters.
...
...
src/bin/pg_upgrade/pg_upgrade.h
View file @
5a3022fd
...
@@ -206,7 +206,6 @@ typedef struct
...
@@ -206,7 +206,6 @@ typedef struct
uint32
ctrl_ver
;
uint32
ctrl_ver
;
uint32
cat_ver
;
uint32
cat_ver
;
char
nextxlogfile
[
25
];
char
nextxlogfile
[
25
];
uint32
chkpnt_tli
;
uint32
chkpnt_nxtxid
;
uint32
chkpnt_nxtxid
;
uint32
chkpnt_nxtepoch
;
uint32
chkpnt_nxtepoch
;
uint32
chkpnt_nxtoid
;
uint32
chkpnt_nxtoid
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment