Thread: two issues with v12 beta3
One of our customers is shutting down, so I took the opportunity to upgrade their DB to v12b3. I found 2 issues: The initscript and refuses to start for beta versions. |[pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start | |An old version of the database format was found. |You need to upgrade the data format before using PostgreSQL. |See (Your System's documentation directory)/postgresql-12beta2/README.rpm-dist for more information. Due to: ++ cat /var/lib/pgsql/12/data/PG_VERSION + '[' x12 '!=' x12beta2 ']' # PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION) PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` I guess it should s/beta[0-9]*$//, or (I suggested in the past): PGMAJORVERSION=${PGVERSION%%.*} Also, for centos6, v12b2 is available but not 12b3?? [pryzbyj@telsasoft ~]$ sudo yum list --showdu postgresql12 Loaded plugins: fastestmirror, rhnplugin, security There was an error communicating with RHN. Red Hat Satellite or RHN Classic support will be disabled. rhn-plugin: Error communicating with server. The message was: Connection reset by peer Loading mirror speeds from cached hostfile * base: mirror.hostduplex.com * extras: centos.mirrors.tds.net * ius: ord.mirror.rackspace.com * rpmforge: rpmfind.net * updates: mirror.sfo12.us.leaseweb.net Installed Packages postgresql12.x86_64 12beta2-1PGDG.rhel6 @pgdg12-updates-testing Available Packages postgresql12.x86_64 12beta1-1PGDG.rhel6 pgdg12-updates-testing postgresql12.x86_64 12beta2-1PGDG.rhel6 pgdg12-updates-testing https://download.postgresql.org/pub/repos/yum/testing/12/redhat/rhel-6-x86_64/ Which is strange..since I've already upgraded to b3....
Hi Justin, On Thu, 2019-08-22 at 07:46 -0500, Justin Pryzby wrote: > One of our customers is shutting down, so I took the opportunity to upgrade > their DB to v12b3. > > I found 2 issues: > > The initscript and refuses to start for beta versions. > > [pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start > > > > An old version of the database format was found. > > You need to upgrade the data format before using PostgreSQL. > > See (Your System's documentation directory)/postgresql-12beta2/README.rpm- > > dist for more information. > > Due to: > ++ cat /var/lib/pgsql/12/data/PG_VERSION > + '[' x12 '!=' x12beta2 ']' > > # PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION) > PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > > I guess it should s/beta[0-9]*$//, or (I suggested in the past): > PGMAJORVERSION=${PGVERSION%%.*} Fixed. Thanks for the report. > > Also, for centos6, v12b2 is available but not 12b3?? *sigh* . It was an issue with CentOS 6 sync scripts. Sorry. So, I used this chance to rebuild beta3 with the fix above. They will be available in next 30 mins. Thanks again. Regards, -- Devrim Gündüz Open Source Solution Architect, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
On Thu, Aug 22, 2019 at 05:52:34PM +0300, Devrim Gündüz wrote: > > Hi Justin, > > On Thu, 2019-08-22 at 07:46 -0500, Justin Pryzby wrote: > > One of our customers is shutting down, so I took the opportunity to upgrade > > their DB to v12b3. > > > > I found 2 issues: > > > > The initscript and refuses to start for beta versions. > > > [pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start > > > > > > An old version of the database format was found. > > > You need to upgrade the data format before using PostgreSQL. > > > See (Your System's documentation directory)/postgresql-12beta2/README.rpm- > > > dist for more information. > > > > Due to: > > ++ cat /var/lib/pgsql/12/data/PG_VERSION > > + '[' x12 '!=' x12beta2 ']' > > > > # PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION) > > PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > > > > I guess it should s/beta[0-9]*$//, or (I suggested in the past): > > PGMAJORVERSION=${PGVERSION%%.*} > > Fixed. Thanks for the report. I think the patch is wrong. It used to do: -PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` meaning: remove trailing .* suffix. That's still necessary (well it will be in November when 12.1 is scheduled to be released). Need to ALSO remove betaN. https://git.postgresql.org/gitweb/?p=pgrpms.git;a=commitdiff;h=1f870b1071c1c35793796220522e6c9929692e85 I proposed: PGMAJORVERSION=${PGVERSION%%.*} meaning: remove maximum suffix matching .* (literal dot, not a shell metachar) ... without forking and relying on sed. It's my understanding that's portable POSIX shell. And, you could do: PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) > > Also, for centos6, v12b2 is available but not 12b3?? > > *sigh* . It was an issue with CentOS 6 sync scripts. Sorry. > > So, I used this chance to rebuild beta3 with the fix above. They will be > available in next 30 mins. Not yet, but I'm in no rush. It looks like I really did install the previous betas (at least v3 on centos7) but apparently never restarted, since the catalog version was changed and I never noticed that nor the initscript. Justin
On Thu, Aug 22, 2019 at 11:21:21AM -0500, Justin Pryzby wrote: > And, you could do: > PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) I take that back; PGPREVMAJORVERSION is used for the upgrade path (which I've never used). The prior version could be anything since 8.4, since it's allowed to pg_upgrade to "skip across" major versions (like from 9.6 to 11). So it should either be configurable, with a default, like: # Assign previous major version from current version if not set in environment: : ${PGPREVMAJORVERSION:=$((PGMAJORVERSION-1))} Or otherwise it should be detected, perhaps like: # Should run as user: postgres psql postgres -Atc "SELECT current_setting('server_version')" 12beta2 Also, I noticed in the upgrade case the initscript says "su" instead of $SU. Justin
Checking back about these On Thu, Aug 22, 2019 at 11:21:21AM -0500, Justin Pryzby wrote: > On Thu, Aug 22, 2019 at 05:52:34PM +0300, Devrim Gündüz wrote: > > > > Hi Justin, > > > > On Thu, 2019-08-22 at 07:46 -0500, Justin Pryzby wrote: > > > One of our customers is shutting down, so I took the opportunity to upgrade > > > their DB to v12b3. > > > > > > I found 2 issues: > > > > > > The initscript and refuses to start for beta versions. > > > > [pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start > > > > > > > > An old version of the database format was found. > > > > You need to upgrade the data format before using PostgreSQL. > > > > See (Your System's documentation directory)/postgresql-12beta2/README.rpm- > > > > dist for more information. > > > > > > Due to: > > > ++ cat /var/lib/pgsql/12/data/PG_VERSION > > > + '[' x12 '!=' x12beta2 ']' > > > > > > # PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION) > > > PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > > > > > > I guess it should s/beta[0-9]*$//, or (I suggested in the past): > > > PGMAJORVERSION=${PGVERSION%%.*} > > > > Fixed. Thanks for the report. > > I think the patch is wrong. > It used to do: -PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > meaning: remove trailing .* suffix. That's still necessary (well it will be in > November when 12.1 is scheduled to be released). Need to ALSO remove betaN. > https://git.postgresql.org/gitweb/?p=pgrpms.git;a=commitdiff;h=1f870b1071c1c35793796220522e6c9929692e85 > > I proposed: PGMAJORVERSION=${PGVERSION%%.*} > meaning: remove maximum suffix matching .* (literal dot, not a shell metachar) > ... without forking and relying on sed. > It's my understanding that's portable POSIX shell. > > And, you could do: > PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) > > > > Also, for centos6, v12b2 is available but not 12b3?? > > > > *sigh* . It was an issue with CentOS 6 sync scripts. Sorry. > > > > So, I used this chance to rebuild beta3 with the fix above. They will be > > available in next 30 mins. > > Not yet, but I'm in no rush. It looks like I really did install the previous > betas (at least v3 on centos7) but apparently never restarted, since the > catalog version was changed and I never noticed that nor the initscript. > > Justin On Thu, Aug 22, 2019 at 12:47:45PM -0500, Justin Pryzby wrote: > On Thu, Aug 22, 2019 at 11:21:21AM -0500, Justin Pryzby wrote: > > And, you could do: > > PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) > > I take that back; PGPREVMAJORVERSION is used for the upgrade path (which I've > never used). > > The prior version could be anything since 8.4, since it's allowed to pg_upgrade > to "skip across" major versions (like from 9.6 to 11). > > So it should either be configurable, with a default, like: > # Assign previous major version from current version if not set in environment: > : ${PGPREVMAJORVERSION:=$((PGMAJORVERSION-1))} > > Or otherwise it should be detected, perhaps like: > # Should run as user: postgres > psql postgres -Atc "SELECT current_setting('server_version')" > 12beta2 > > Also, I noticed in the upgrade case the initscript says "su" instead of $SU. > > Justin
Hi Justin, On Wed, 2019-08-28 at 18:51 -0500, Justin Pryzby wrote: > Checking back about these Working on EPEL 8 nowadays, will look soon. Regards, -- Devrim Gündüz Open Source Solution Architect, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment
A reminder that there's still an issue with the initscript in rc1 for RH6. [pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start An old version of the database format was found. You need to upgrade the data format before using PostgreSQL. See (Your System's documentation directory)/postgresql-12rc1/README.rpm-dist for more information. I think maybe what's needed is this: -PGMAJORVERSION=`echo "$PGVERSION" | sed 's/beta[0-9]*$//'` +PGMAJORVERSION=`echo "$PGVERSION" | sed -r 's/(\.|rc|beta)[0-9]*$//'` Note, I think what I said before about ${PGVERSION%%.*} wouldn't work for beta/rc. On Wed, Aug 28, 2019 at 06:51:51PM -0500, Justin Pryzby wrote: > Checking back about these > > On Thu, Aug 22, 2019 at 11:21:21AM -0500, Justin Pryzby wrote: > > On Thu, Aug 22, 2019 at 05:52:34PM +0300, Devrim Gündüz wrote: > > > > > > Hi Justin, > > > > > > On Thu, 2019-08-22 at 07:46 -0500, Justin Pryzby wrote: > > > > One of our customers is shutting down, so I took the opportunity to upgrade > > > > their DB to v12b3. > > > > > > > > I found 2 issues: > > > > > > > > The initscript and refuses to start for beta versions. > > > > > [pryzbyj@telsasoft ~]$ sudo /etc/init.d/postgresql-12 start > > > > > > > > > > An old version of the database format was found. > > > > > You need to upgrade the data format before using PostgreSQL. > > > > > See (Your System's documentation directory)/postgresql-12beta2/README.rpm- > > > > > dist for more information. > > > > > > > > Due to: > > > > ++ cat /var/lib/pgsql/12/data/PG_VERSION > > > > + '[' x12 '!=' x12beta2 ']' > > > > > > > > # PGMAJORVERSION is major version, e.g., 10 (this should match PG_VERSION) > > > > PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > > > > > > > > I guess it should s/beta[0-9]*$//, or (I suggested in the past): > > > > PGMAJORVERSION=${PGVERSION%%.*} > > > > > > Fixed. Thanks for the report. > > > > I think the patch is wrong. > > It used to do: -PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\)\.[0-9]*$/\1/'` > > meaning: remove trailing .* suffix. That's still necessary (well it will be in > > November when 12.1 is scheduled to be released). Need to ALSO remove betaN. > > https://git.postgresql.org/gitweb/?p=pgrpms.git;a=commitdiff;h=1f870b1071c1c35793796220522e6c9929692e85 > > > > I proposed: PGMAJORVERSION=${PGVERSION%%.*} > > meaning: remove maximum suffix matching .* (literal dot, not a shell metachar) > > ... without forking and relying on sed. > > It's my understanding that's portable POSIX shell. > > > > And, you could do: > > PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) > > > > > > Also, for centos6, v12b2 is available but not 12b3?? > > > > > > *sigh* . It was an issue with CentOS 6 sync scripts. Sorry. > > > > > > So, I used this chance to rebuild beta3 with the fix above. They will be > > > available in next 30 mins. > > > > Not yet, but I'm in no rush. It looks like I really did install the previous > > betas (at least v3 on centos7) but apparently never restarted, since the > > catalog version was changed and I never noticed that nor the initscript. > > > > Justin > > On Thu, Aug 22, 2019 at 12:47:45PM -0500, Justin Pryzby wrote: > > On Thu, Aug 22, 2019 at 11:21:21AM -0500, Justin Pryzby wrote: > > > And, you could do: > > > PGPREVMAJORVERSION=$((PGMAJORVERSION-1)) > > > > I take that back; PGPREVMAJORVERSION is used for the upgrade path (which I've > > never used). > > > > The prior version could be anything since 8.4, since it's allowed to pg_upgrade > > to "skip across" major versions (like from 9.6 to 11). > > > > So it should either be configurable, with a default, like: > > # Assign previous major version from current version if not set in environment: > > : ${PGPREVMAJORVERSION:=$((PGMAJORVERSION-1))} > > > > Or otherwise it should be detected, perhaps like: > > # Should run as user: postgres > > psql postgres -Atc "SELECT current_setting('server_version')" > > 12beta2 > > > > Also, I noticed in the upgrade case the initscript says "su" instead of $SU. -- Justin Pryzby System Administrator Telsasoft +1-952-707-8581