Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

Started by Kumari, Jyotiabout 5 years ago4 messagesbugs
Jump to latest
#1Kumari, Jyoti
Jyoti.K@dell.com

Internal Use - Confidential

Hi Team,

We are facing an issue during pg_upgrade from 9.6 to 12.3. Below is the exception while running pg_upgrade.exe

C:\NewDatastore\engine\bin>C:\NewDatastore\engine\bin\pg_upgrade.exe -b C:\old_datastore\engine\bin -B C:\NewDatastore\engine\bin -d C:\old_datastore\data -D C:\NewDatastore\data -p 50432 -P 50444 --check

Performing Consistency Checks
-----------------------------
Checking cluster versions ok

connection to database failed: FATAL: could not read block 12 in file "base/1/1259": read only 0 of 8192 bytes.

We caught up with the same exception in the two server.

We need your assistance on this asap.

Jyoti Sinha
Dell EMC

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kumari, Jyoti (#1)
Re: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

"Kumari, Jyoti" <Jyoti.K@dell.com> writes:

connection to database failed: FATAL: could not read block 12 in file "base/1/1259": read only 0 of 8192 bytes.

Looks like your template1 database is corrupt.

I think you could get out of this by dropping template1 and re-creating
it from template0. However, the usual caveats for working with damaged
databases apply: it's a good idea to make a filesystem-level backup of
the entire database directory before you do anything. That way you
can at least get back to where you were if things go further wrong.

regards, tom lane

#3Kumari, Jyoti
Jyoti.K@dell.com
In reply to: Kumari, Jyoti (#1)
RE: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

Internal Use - Confidential

Hi Tom and the Team,

I am yet to get your response on the below ask, Can you please have a look on this?

Jyoti Sinha
Dell EMC

-----Original Message-----
From: Kumari, Jyoti
Sent: Monday, March 1, 2021 11:14 AM
To: Tom Lane
Cc: pgsql-bugs@lists.postgresql.org; Tamrakar, Animesh; Pokharna, Prashant; Bharti, Anand
Subject: RE: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

Internal Use - Confidential

Hi Tom,

Thank you for the quick reply!

Are you referring the base\1 folder as template 1?

Could you please elaborate the below suggestions step by step without losing a customer data?

Jyoti Sinha
Dell EMC

-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Friday, February 26, 2021 10:06 PM
To: Kumari, Jyoti
Cc: pgsql-bugs@lists.postgresql.org; Tamrakar, Animesh; Pokharna, Prashant; Bharti, Anand
Subject: Re: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

[EXTERNAL EMAIL]

"Kumari, Jyoti" <Jyoti.K@dell.com> writes:

connection to database failed: FATAL: could not read block 12 in file "base/1/1259": read only 0 of 8192 bytes.

Looks like your template1 database is corrupt.

I think you could get out of this by dropping template1 and re-creating it from template0. However, the usual caveats for working with damaged databases apply: it's a good idea to make a filesystem-level backup of the entire database directory before you do anything. That way you can at least get back to where you were if things go further wrong.

regards, tom lane

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kumari, Jyoti (#3)
Re: Upgrade issue during Postgres 9.6 to 12.3 on the two and more server

"Kumari, Jyoti" <Jyoti.K@dell.com> writes:

I am yet to get your response on the below ask, Can you please have a look on this?

What I was suggesting was dropping the template1 database and
re-cloning it from template0. See

https://www.postgresql.org/docs/current/manage-ag-templatedbs.html

regards, tom lane