Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd7d00a

Browse files
committed
Improve pg_upgrade commentary on multixact change
Per gripe from Andres Freund
1 parent63d283e commitcd7d00a

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

‎contrib/pg_upgrade/controldata.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
470470
/* verify that we got all the mandatory pg_control data */
471471
if (!got_xid|| !got_oid||
472472
!got_multi|| !got_mxoff||
473-
(!got_oldestmulti&&cluster->controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER)||
473+
(!got_oldestmulti&&
474+
cluster->controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER)||
474475
(!live_check&& !got_nextxlogfile)||
475476
!got_tli||
476477
!got_align|| !got_blocksz|| !got_largesz|| !got_walsz||
@@ -493,7 +494,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
493494
if (!got_mxoff)
494495
pg_log(PG_REPORT," latest checkpoint next MultiXactOffset\n");
495496

496-
if (!got_oldestmulti&&cluster->controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER)
497+
if (!got_oldestmulti&&
498+
cluster->controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER)
497499
pg_log(PG_REPORT," latest checkpoint oldest MultiXactId\n");
498500

499501
if (!live_check&& !got_nextxlogfile)

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,10 @@ copy_clog_xlog_xid(void)
407407
check_ok();
408408

409409
/*
410-
* If both new and old are after the pg_multixact change commit, copy those
411-
* files too. If the old server is before that change and the new server
412-
* is after, then we don't copy anything but we need to reset pg_control so
413-
* that the new server doesn't attempt to read multis older than the cutoff
414-
* value.
410+
* If the old server is before the MULTIXACT_FORMATCHANGE_CAT_VER change
411+
* (see pg_upgrade.h) and the new server is after, then we don't copy
412+
* pg_multixact files, but we need to reset pg_control so that the new
413+
* server doesn't attempt to read multis older than the cutoff value.
415414
*/
416415
if (old_cluster.controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER&&
417416
new_cluster.controldata.cat_ver >=MULTIXACT_FORMATCHANGE_CAT_VER)

‎contrib/pg_upgrade/pg_upgrade.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ extern char *output_files[];
109109
#defineVISIBILITY_MAP_CRASHSAFE_CAT_VER 201107031
110110

111111
/*
112-
* pg_multixact format changed in this catversion:
112+
* pg_multixact format changed in 9.3 commit 0ac5ad5134f2769ccbaefec73844f85,
113+
* ("Improve concurrency of foreign key locking") which also updated catalog
114+
* version to this value. pg_upgrade behavior depends on whether old and new
115+
* server versions are both newer than this, or only the new one is.
113116
*/
114117
#defineMULTIXACT_FORMATCHANGE_CAT_VER 201301231
115118

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp