pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Don't archive bogus recycled or preallocated files after timelin
10+ messages / 3 participants
[nested] [flat]
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 23:24 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/b2a5545bd63fc94a71b1e97ecdd03c605d97a438
Modified Files
--------------
src/backend/access/transam/xlog.c | 280 ++++++++++++++++++++----------
src/backend/access/transam/xlogarchive.c | 19 ++
src/include/access/xlog_internal.h | 1 +
3 files changed, 211 insertions(+), 89 deletions(-)
--
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] 10+ messages in thread
* Re: pgsql: Don't archive bogus recycled or preallocated files after timelin
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
@ 2015-04-13 23:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 06:38 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <hlinnaka@iki.fi>
0 siblings, 1 reply; 10+ messages in thread
From: Tom Lane @ 2015-04-13 23:24 UTC (permalink / raw)
To: Heikki Linnakangas <heikki.linnakangas@iki.fi>; +Cc: pgsql-committers
Heikki Linnakangas <heikki.linnakangas@iki.fi> writes:
> To fix, whenever we switch to a new timeline, scan the data directory for
> WAL segments on the old timeline, but with a higher segment number, and
> remove them.
Wait a minute. Didn't you just break PITR scenarios? The *entire point*
of the multiple-timeline mechanism is that you can start a new WAL history
from a point in the past without destroying WAL history after that point
on the old timeline.
I've not read the patch, so maybe the code is all right, but this
description most certainly is not.
regards, tom lane
--
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] 10+ messages in thread
* Re: pgsql: Don't archive bogus recycled or preallocated files after timelin
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 23:24 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-04-14 06:38 ` Heikki Linnakangas <hlinnaka@iki.fi>
2015-04-14 14:32 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-14 06:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers
On 04/14/2015 02:24 AM, Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@iki.fi> writes:
>> To fix, whenever we switch to a new timeline, scan the data directory for
>> WAL segments on the old timeline, but with a higher segment number, and
>> remove them.
>
> Wait a minute. Didn't you just break PITR scenarios? The *entire point*
> of the multiple-timeline mechanism is that you can start a new WAL history
> from a point in the past without destroying WAL history after that point
> on the old timeline.
It deletes the files belonging to other timelines from pg_xlog only. The
WAL archive is not touched.
- Heikki
--
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] 10+ messages in thread
* Re: pgsql: Don't archive bogus recycled or preallocated files after timelin
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 23:24 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 06:38 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <hlinnaka@iki.fi>
@ 2015-04-14 14:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 14:49 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <hlinnaka@iki.fi>
0 siblings, 1 reply; 10+ messages in thread
From: Tom Lane @ 2015-04-14 14:32 UTC (permalink / raw)
To: hlinnaka@iki.fi; +Cc: pgsql-committers
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 04/14/2015 02:24 AM, Tom Lane wrote:
>> Wait a minute. Didn't you just break PITR scenarios? The *entire point*
>> of the multiple-timeline mechanism is that you can start a new WAL history
>> from a point in the past without destroying WAL history after that point
>> on the old timeline.
> It deletes the files belonging to other timelines from pg_xlog only. The
> WAL archive is not touched.
How do we know those files are in the WAL archive?
regards, tom lane
--
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] 10+ messages in thread
* Re: pgsql: Don't archive bogus recycled or preallocated files after timelin
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 23:24 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 06:38 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <hlinnaka@iki.fi>
2015-04-14 14:32 ` Re: pgsql: Don't archive bogus recycled or preallocated files after timelin Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-04-14 14:49 ` Heikki Linnakangas <hlinnaka@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-14 14:49 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers
On 04/14/2015 05:32 PM, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> On 04/14/2015 02:24 AM, Tom Lane wrote:
>>> Wait a minute. Didn't you just break PITR scenarios? The *entire point*
>>> of the multiple-timeline mechanism is that you can start a new WAL history
>>> from a point in the past without destroying WAL history after that point
>>> on the old timeline.
>
>> It deletes the files belonging to other timelines from pg_xlog only. The
>> WAL archive is not touched.
>
> How do we know those files are in the WAL archive?
Presumably that's where they came from if you're doing PITR. Or they
were copied into pg_xlog manually from somewhere else.
After PITR, if you decide that you didn't like the result and perform
another recovery, you have to restore from a base backup again, which
will wipe out pg_xlog anyway.
Also, if the recovery continued longer, those files would be deleted
from pg_xlog anyway, at a later restartpoint.
- Heikki
--
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] 10+ messages in thread
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/d72792d0213ec352cdb71f3994a53194bc00f220
Modified Files
--------------
src/backend/access/transam/xlog.c | 283 ++++++++++++++++++++----------
src/backend/access/transam/xlogarchive.c | 19 ++
src/include/access/xlog_internal.h | 1 +
3 files changed, 209 insertions(+), 94 deletions(-)
--
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] 10+ messages in thread
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/a800267e46781b0eebd43db8150ca558c9f687c6
Modified Files
--------------
src/backend/access/transam/xlog.c | 282 ++++++++++++++++++++----------
src/backend/access/transam/xlogarchive.c | 19 ++
src/include/access/xlog_internal.h | 1 +
3 files changed, 208 insertions(+), 94 deletions(-)
--
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] 10+ messages in thread
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
REL9_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/cc2939f44253b31ca16c98d1c846fcee04517cc9
Modified Files
--------------
src/backend/access/transam/xlog.c | 280 +++++++++++++++++++++++++------------
1 file changed, 193 insertions(+), 87 deletions(-)
--
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] 10+ messages in thread
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
REL9_1_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/ad2925e2032336a7a78cafe3839efa96cec86dcd
Modified Files
--------------
src/backend/access/transam/xlog.c | 284 +++++++++++++++++++++++++------------
1 file changed, 197 insertions(+), 87 deletions(-)
--
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] 10+ messages in thread
* pgsql: Don't archive bogus recycled or preallocated files after timelin
@ 2015-04-13 14:56 Heikki Linnakangas <heikki.linnakangas@iki.fi>
0 siblings, 0 replies; 10+ messages in thread
From: Heikki Linnakangas @ 2015-04-13 14:56 UTC (permalink / raw)
To: pgsql-committers
Don't archive bogus recycled or preallocated files after timeline switch.
After a timeline switch, we would leave behind recycled WAL segments that
are in the future, but on the old timeline. After promotion, and after they
become old enough to be recycled again, we would notice that they don't have
a .ready or .done file, create a .ready file for them, and archive them.
That's bogus, because the files contain garbage, recycled from an older
timeline (or prealloced as zeros). We shouldn't archive such files.
This could happen when we're following a timeline switch during replay, or
when we switch to new timeline at end-of-recovery.
To fix, whenever we switch to a new timeline, scan the data directory for
WAL segments on the old timeline, but with a higher segment number, and
remove them. Those don't belong to our timeline history, and are most
likely bogus recycled or preallocated files. They could also be valid files
that we streamed from the primary ahead of time, but in any case, they're
not needed to recover to the new timeline.
Branch
------
REL9_0_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/5b6938186a4a9608bd278409c2c3ee5afe6ad0c8
Modified Files
--------------
src/backend/access/transam/xlog.c | 284 +++++++++++++++++++++++++------------
1 file changed, 197 insertions(+), 87 deletions(-)
--
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] 10+ messages in thread
end of thread, other threads:[~2015-04-14 14:49 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 23:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 06:38 ` Heikki Linnakangas <hlinnaka@iki.fi>
2015-04-14 14:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-04-14 14:49 ` Heikki Linnakangas <hlinnaka@iki.fi>
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-04-13 14:56 pgsql: Don't archive bogus recycled or preallocated files after timelin Heikki Linnakangas <heikki.linnakangas@iki.fi>
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