pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
6+ messages / 1 participants
[nested] [flat]

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f3db7f164a29c5cbdc1d6d5d0d23854df58783c1

Modified Files
--------------
doc/src/sgml/ref/pg_resetwal.sgml |  5 +++
src/bin/pg_resetwal/pg_resetwal.c | 70 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/98bff290747e50b53f0076d69f239a13e032c7e1

Modified Files
--------------
doc/src/sgml/ref/pg_resetxlog.sgml  |  5 +++
src/bin/pg_resetxlog/pg_resetxlog.c | 70 ++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5bcbc4cd6d9ca29fe3da9c609bfeb5357982a4e9

Modified Files
--------------
doc/src/sgml/ref/pg_resetxlog.sgml  |  5 +++
src/bin/pg_resetxlog/pg_resetxlog.c | 70 ++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9ed68f64114e357f958cd80ba574413b097a2c12

Modified Files
--------------
doc/src/sgml/ref/pg_resetxlog.sgml  |  5 +++
src/bin/pg_resetxlog/pg_resetxlog.c | 70 ++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/78e4fb8e41df1c425fc097cb6c94d0fd75931632

Modified Files
--------------
doc/src/sgml/ref/pg_resetxlog.sgml  |  5 +++
src/bin/pg_resetxlog/pg_resetxlog.c | 70 ++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d
@ 2017-05-29 21:08 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-05-29 21:08 UTC (permalink / raw)
  To: pgsql-committers

Prevent running pg_resetwal/pg_resetxlog against wrong-version data dirs.

pg_resetwal (formerly pg_resetxlog) doesn't insist on finding a matching
version number in pg_control, and that seems like an important thing to
preserve since recovering from corrupt pg_control is a prime reason to
need to run it.  However, that means you can try to run it against a
data directory of a different major version, which is at best useless
and at worst disastrous.  So as to provide some protection against that
type of pilot error, inspect PG_VERSION at startup and refuse to do
anything if it doesn't match.  PG_VERSION is read-only after initdb,
so it's unlikely to get corrupted, and even if it were corrupted it would
be easy to fix by hand.

This hazard has been there all along, so back-patch to all supported
branches.

Michael Paquier, with some kibitzing by me

Discussion: https://postgr.es/m/f4b8eb91-b934-8a0d-b3cc-68f06e2279d1@enterprisedb.com

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6b48f06da85ecf3daadcf73c5c9872f126573ef8

Modified Files
--------------
doc/src/sgml/ref/pg_resetxlog.sgml  |  5 +++
src/bin/pg_resetxlog/pg_resetxlog.c | 70 ++++++++++++++++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2017-05-29 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>
2017-05-29 21:08 pgsql: Prevent running pg_resetwal/pg_resetxlog against wrong-version d Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox