Re: Online enabling of checksums

2018-03-30 Thread Tomas Vondra
Hi, I've just noticed the patch does not update src/backend/storage/page/README which is in fact about checksums. Most of it remains valid, but it also mentions that currently it's an initdb-time choice. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL

Re: Online enabling of checksums

2018-03-27 Thread Tomas Vondra
On 03/27/2018 08:56 AM, Magnus Hagander wrote: > On Mon, Mar 26, 2018 at 10:09 PM, Tomas Vondra > > wrote: > > Hi, > > I see enable_data_checksums() does this: > >     if (cost_limit <= 0) >        

Re: Online enabling of checksums

2018-03-27 Thread Magnus Hagander
On Mon, Mar 26, 2018 at 10:09 PM, Tomas Vondra wrote: > Hi, > > I see enable_data_checksums() does this: > > if (cost_limit <= 0) > ereport(ERROR, > (errmsg("cost limit must be a positive value"))); > > Is there a reason not to allow -1

Re: Online enabling of checksums

2018-03-26 Thread Tomas Vondra
Hi, I see enable_data_checksums() does this: if (cost_limit <= 0) ereport(ERROR, (errmsg("cost limit must be a positive value"))); Is there a reason not to allow -1 (no limit), just like for vacuum_cost? regards -- Tomas Vondra

Re: Online enabling of checksums

2018-03-20 Thread Magnus Hagander
On Mon, Mar 19, 2018 at 7:27 AM, Heikki Linnakangas wrote: > Hi, > > The patch looks good to me at a high level. Some notes below. I didn't > read through the whole thread, so sorry if some of these have been > discussed already. > > +void >>

Re: Online enabling of checksums

2018-03-20 Thread Magnus Hagander
On Tue, Mar 20, 2018 at 10:29 AM, Andrey Borodin wrote: > Hi! > > > 19 марта 2018 г., в 11:27, Heikki Linnakangas > написал(а): > > > > Is there no way to stop the checksum helper once it's started? That > seems rather user-unfriendly. I can imagine it

Re: Online enabling of checksums

2018-03-20 Thread Andrey Borodin
Hi! > 19 марта 2018 г., в 11:27, Heikki Linnakangas написал(а): > > Is there no way to stop the checksum helper once it's started? That seems > rather user-unfriendly. I can imagine it being a pretty common mistake to > call pg_enable_data_checksums() on a 10 TB cluster, only

Re: Online enabling of checksums

2018-03-19 Thread Andrey Borodin
Hi Magnus! > 19 марта 2018 г., в 16:57, Magnus Hagander написал(а): > > On Mon, Mar 19, 2018 at 12:24 PM, Magnus Hagander > wrote: > On Mon, Mar 19, 2018 at 11:40 AM, Andrey Borodin

Re: Online enabling of checksums

2018-03-19 Thread Magnus Hagander
On Mon, Mar 19, 2018 at 12:24 PM, Magnus Hagander wrote: > On Mon, Mar 19, 2018 at 11:40 AM, Andrey Borodin > wrote: > >> Hi, Daniel! >> >> > 19 марта 2018 г., в 4:01, Daniel Gustafsson >> написал(а): >> > >> > Fixed in patch just

Re: Online enabling of checksums

2018-03-19 Thread Magnus Hagander
On Mon, Mar 19, 2018 at 11:40 AM, Andrey Borodin wrote: > Hi, Daniel! > > > 19 марта 2018 г., в 4:01, Daniel Gustafsson > написал(а): > > > > Fixed in patch just posted in 84693D0C-772F-45C2-88A1- > 85b4983a5...@yesql.se > > (version 5). Thanks! > > > I've

Re: Online enabling of checksums

2018-03-19 Thread Andrey Borodin
Hi, Daniel! > 19 марта 2018 г., в 4:01, Daniel Gustafsson написал(а): > > Fixed in patch just posted in 84693d0c-772f-45c2-88a1-85b4983a5...@yesql.se > (version 5). Thanks! I've been hacking a bit in neighboring thread. And come across one interesting thing. There was a patch

Re: Online enabling of checksums

2018-03-19 Thread Heikki Linnakangas
Hi, The patch looks good to me at a high level. Some notes below. I didn't read through the whole thread, so sorry if some of these have been discussed already. +void +ShutdownChecksumHelperIfRunning(void) +{ + if (pg_atomic_unlocked_test_flag(>launcher_started)) + { +

Re: Online enabling of checksums

2018-03-18 Thread Daniel Gustafsson
> On 18 Mar 2018, at 15:02, Michael Banck wrote: > On Thu, Mar 15, 2018 at 02:01:26PM +0100, Daniel Gustafsson wrote: >>> On 10 Mar 2018, at 16:09, Michael Banck wrote: >>> I am aware that this is discussed already, but as-is the user

Re: Online enabling of checksums

2018-03-18 Thread Andrey Borodin
Hi! > 18 марта 2018 г., в 19:02, Michael Banck > написал(а): > > Otherwise, I had a quick look over v4 and found no further issues. > Hopefully I will be able to test it on some bigger test databases next > week. > > I'm switching the state back to 'Waiting on

Re: Online enabling of checksums

2018-03-18 Thread Michael Banck
Hi, On Thu, Mar 15, 2018 at 02:01:26PM +0100, Daniel Gustafsson wrote: > > On 10 Mar 2018, at 16:09, Michael Banck wrote: > > I am aware that this is discussed already, but as-is the user experience > > is pretty bad, I think pg_enable_data_checksums() should either

Re: Online enabling of checksums

2018-03-15 Thread Daniel Gustafsson
> On 10 Mar 2018, at 16:09, Michael Banck wrote: > I had a closer look at v3 of the patch now. Thanks, much appreciated! Sorry for the late response, just came back from a conference and have had little time for hacking. All whitespace, punctuation and

Re: Online enabling of checksums

2018-03-10 Thread Michael Banck
Hi, I had a closer look at v3 of the patch now. On Sat, Mar 03, 2018 at 07:23:31PM +0100, Magnus Hagander wrote: > Attached is a rebased patch which removes this optimization, updates the > pg_proc entry for the new format, and changes pg_verify_checksums to use -r > instead of -o for

Re: Online enabling of checksums

2018-03-10 Thread Michael Banck
Hi, On Mon, Mar 05, 2018 at 11:09:02AM +0100, Magnus Hagander wrote: > On Mon, Mar 5, 2018 at 10:43 AM, Michael Banck > wrote: > > I still find that confusing, but maybe it's just me. I thought the one > > in the pageheader is the "expected" checksum, and we compare

Re: Online enabling of checksums

2018-03-05 Thread Magnus Hagander
On Mon, Mar 5, 2018 at 10:43 AM, Michael Banck wrote: > Hi, > > Am Sonntag, den 04.03.2018, 23:30 +0100 schrieb Daniel Gustafsson: > > Agreed. Looking at our current error messages, “in file” is > conventionally > > followed by the filename. I do however think

Re: Online enabling of checksums

2018-03-05 Thread Michael Banck
Hi, Am Sonntag, den 04.03.2018, 23:30 +0100 schrieb Daniel Gustafsson: > Agreed. Looking at our current error messages, “in file” is conventionally > followed by the filename. I do however think “calculated” is better than > “expected” since it conveys clearly that the compared checksum is

Re: Online enabling of checksums

2018-03-04 Thread Daniel Gustafsson
> On 04 Mar 2018, at 15:24, Michael Banck wrote: >> +csum = pg_checksum_page(buf, blockno + segmentno*RELSEG_SIZE); >> +if (csum != header->pd_checksum) >> +{ >> +if (ControlFile->data_checksum_version == >>

Re: Online enabling of checksums

2018-03-04 Thread Michael Banck
Hi, On Sat, Mar 03, 2018 at 07:23:31PM +0100, Magnus Hagander wrote: > diff --git a/src/bin/pg_verify_checksums/pg_verify_checksums.c > b/src/bin/pg_verify_checksums/pg_verify_checksums.c > new file mode 100644 > index 00..a4bfe7284d > --- /dev/null > +++

Re: Online enabling of checksums

2018-03-03 Thread Magnus Hagander
On Sat, Mar 3, 2018 at 5:17 PM, Tomas Vondra wrote: > > > On 03/03/2018 05:08 PM, Magnus Hagander wrote: > > > > > > On Sat, Mar 3, 2018 at 5:06 PM, Tomas Vondra > > > > wrote: > > > > On

Re: Online enabling of checksums

2018-03-03 Thread Tomas Vondra
On 03/03/2018 05:08 PM, Magnus Hagander wrote: > > > On Sat, Mar 3, 2018 at 5:06 PM, Tomas Vondra > > wrote: > > On 03/03/2018 01:38 PM, Robert Haas wrote: > > On Sat, Mar 3, 2018 at 7:32 AM, Robert Haas

Re: Online enabling of checksums

2018-03-03 Thread Magnus Hagander
On Sat, Mar 3, 2018 at 5:06 PM, Tomas Vondra wrote: > On 03/03/2018 01:38 PM, Robert Haas wrote: > > On Sat, Mar 3, 2018 at 7:32 AM, Robert Haas > wrote: > >> On Fri, Mar 2, 2018 at 6:26 PM, Tomas Vondra > >>

Re: Online enabling of checksums

2018-03-03 Thread Tomas Vondra
On 03/03/2018 01:38 PM, Robert Haas wrote: > On Sat, Mar 3, 2018 at 7:32 AM, Robert Haas wrote: >> On Fri, Mar 2, 2018 at 6:26 PM, Tomas Vondra >> wrote: >>> Hmmm, OK. So we need to have a valid checksum on a page, disable >>> checksums, set

Re: Online enabling of checksums

2018-03-03 Thread Robert Haas
On Sat, Mar 3, 2018 at 7:32 AM, Robert Haas wrote: > On Fri, Mar 2, 2018 at 6:26 PM, Tomas Vondra > wrote: >> Hmmm, OK. So we need to have a valid checksum on a page, disable >> checksums, set some hint bits on the page (which won't be

Re: Online enabling of checksums

2018-03-03 Thread Robert Haas
On Fri, Mar 2, 2018 at 6:26 PM, Tomas Vondra wrote: > Hmmm, OK. So we need to have a valid checksum on a page, disable > checksums, set some hint bits on the page (which won't be WAL-logged), > enable checksums again and still get a valid checksum even with the new >

Re: Online enabling of checksums

2018-03-02 Thread Tomas Vondra
On 03/02/2018 11:01 PM, Magnus Hagander wrote: > On Fri, Mar 2, 2018 at 5:50 PM, Tomas Vondra > > wrote: > > > > On 03/02/2018 02:35 PM, Magnus Hagander wrote: > > > > > > On Wed, Feb 28, 2018 at 6:06 PM, Robert

Re: Online enabling of checksums

2018-03-02 Thread Magnus Hagander
On Fri, Mar 2, 2018 at 5:50 PM, Tomas Vondra wrote: > > > On 03/02/2018 02:35 PM, Magnus Hagander wrote: > > > > > > On Wed, Feb 28, 2018 at 6:06 PM, Robert Haas > > wrote: > > > > On Sun, Feb 25, 2018 at

Re: Online enabling of checksums

2018-03-02 Thread Tomas Vondra
On 03/02/2018 02:35 PM, Magnus Hagander wrote: > > > On Wed, Feb 28, 2018 at 6:06 PM, Robert Haas > wrote: > > On Sun, Feb 25, 2018 at 9:54 AM, Magnus Hagander > > wrote: > >

Re: Online enabling of checksums

2018-03-02 Thread Robert Haas
On Fri, Mar 2, 2018 at 2:44 AM, Andres Freund wrote: > And even more so, I'm not even sure it makes sense to try to get this > into v11. This is a medium-large complicated feature, submitted to the > last CF for v11. That's pretty late. Now, Magnus is a committer, but >

Re: Online enabling of checksums

2018-03-02 Thread Robert Haas
On Fri, Mar 2, 2018 at 8:35 AM, Magnus Hagander wrote: > Do we ever make hintbit changes on the standby for example? If so, it would > definitely cause problems. I didn't realize we did, actually... We do not. > I guess we could get there even if we don't by: > * All

Re: Online enabling of checksums

2018-03-02 Thread Tomas Vondra
On 03/02/2018 03:22 PM, Magnus Hagander wrote: > > > On Fri, Mar 2, 2018 at 3:17 PM, Alvaro Herrera > wrote: > > Magnus Hagander wrote: > > On Wed, Feb 28, 2018 at 10:07 PM, Tomas Vondra >

Re: Online enabling of checksums

2018-03-02 Thread Magnus Hagander
On Fri, Mar 2, 2018 at 3:17 PM, Alvaro Herrera wrote: > Magnus Hagander wrote: > > On Wed, Feb 28, 2018 at 10:07 PM, Tomas Vondra < > tomas.von...@2ndquadrant.com > > > > I'd argue this is merely a mistake in the --help text. Firstly, > > > relfilenodes are OIDs too, so

Re: Online enabling of checksums

2018-03-02 Thread Alvaro Herrera
Magnus Hagander wrote: > On Wed, Feb 28, 2018 at 10:07 PM, Tomas Vondra > I'd argue this is merely a mistake in the --help text. Firstly, > > relfilenodes are OIDs too, so I don't think "-o" is incorrect. Secondly, > > the SGML docs actually say: > Yeah, that one

Re: Online enabling of checksums

2018-03-02 Thread Magnus Hagander
On Wed, Feb 28, 2018 at 6:06 PM, Robert Haas wrote: > On Sun, Feb 25, 2018 at 9:54 AM, Magnus Hagander > wrote: > > Also if that wasn't clear -- we only do the full page write if there > isn't > > already a checksum on the page and that checksum is

Re: Online enabling of checksums

2018-03-02 Thread Magnus Hagander
On Wed, Feb 28, 2018 at 10:07 PM, Tomas Vondra wrote: > On 02/28/2018 08:42 PM, Alvaro Herrera wrote: > > I noticed that pg_verify_checksum takes an "-o oid" argument to only > > check the relation with that OID; but that's wrong, because the number > > is a

Re: Online enabling of checksums

2018-03-02 Thread Magnus Hagander
On Fri, Mar 2, 2018 at 8:44 AM, Andres Freund wrote: > On 2018-03-01 16:18:48 +0100, Magnus Hagander wrote: > > On Thu, Mar 1, 2018 at 9:04 AM, Andres Freund > wrote: > > > > > On 2018-03-01 12:56:35 +0500, Andrey Borodin wrote: > > > > I've tried to

Re: Online enabling of checksums

2018-03-01 Thread Andres Freund
On 2018-03-01 16:18:48 +0100, Magnus Hagander wrote: > On Thu, Mar 1, 2018 at 9:04 AM, Andres Freund wrote: > > > On 2018-03-01 12:56:35 +0500, Andrey Borodin wrote: > > > I've tried to rebase this patch to 10 and, despite minor rebase issues > > (oids, bgw_type, changes to

Re: Online enabling of checksums

2018-03-01 Thread Magnus Hagander
On Thu, Mar 1, 2018 at 9:04 AM, Andres Freund wrote: > On 2018-03-01 12:56:35 +0500, Andrey Borodin wrote: > > I've tried to rebase this patch to 10 and, despite minor rebase issues > (oids, bgw_type, changes to specscanner), patch works fine. > > Do we provide backporting

Re: Online enabling of checksums

2018-03-01 Thread Andres Freund
On 2018-03-01 12:56:35 +0500, Andrey Borodin wrote: > I've tried to rebase this patch to 10 and, despite minor rebase issues (oids, > bgw_type, changes to specscanner), patch works fine. > Do we provide backporting for such features? Definitely not. With very rare exceptions (OS compatibility

Re: Online enabling of checksums

2018-03-01 Thread Michael Paquier
On Thu, Mar 01, 2018 at 12:56:35PM +0500, Andrey Borodin wrote: > I've tried to rebase this patch to 10 and, despite minor rebase issues > (oids, bgw_type, changes to specscanner), patch works fine. Do we > provide backporting for such features? New features are not backported in upstream.

Re: Online enabling of checksums

2018-02-28 Thread Andrey Borodin
> 28 февр. 2018 г., в 6:22, Daniel Gustafsson написал(а): > >> Is there any way we could provide this functionality for previous versions >> (9.6,10)? Like implement utility for offline checksum enabling, without >> WAL-logging, surely. > > While outside the scope of the

Re: Online enabling of checksums

2018-02-28 Thread Andrey Borodin
> 28 февр. 2018 г., в 22:06, Robert Haas написал(а): > > On Sun, Feb 25, 2018 at 9:54 AM, Magnus Hagander wrote: >> Also if that wasn't clear -- we only do the full page write if there isn't >> already a checksum on the page and that checksum is

Re: Online enabling of checksums

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 03:42, Alvaro Herrera wrote: > I noticed that pg_verify_checksum takes an "-o oid" argument to only > check the relation with that OID; but that's wrong, because the number > is a relfilenode, not an OID (since it's compared to the on-disk file >

Re: Online enabling of checksums

2018-02-28 Thread Daniel Gustafsson
> On 01 Mar 2018, at 05:07, Tomas Vondra wrote: > > On 02/28/2018 08:42 PM, Alvaro Herrera wrote: >> I noticed that pg_verify_checksum takes an "-o oid" argument to only >> check the relation with that OID; but that's wrong, because the number >> is a relfilenode,

Re: Online enabling of checksums

2018-02-28 Thread Tomas Vondra
On 02/28/2018 08:42 PM, Alvaro Herrera wrote: > I noticed that pg_verify_checksum takes an "-o oid" argument to only > check the relation with that OID; but that's wrong, because the number > is a relfilenode, not an OID (since it's compared to the on-disk file > name). I would suggest changing

Re: Online enabling of checksums

2018-02-28 Thread Alvaro Herrera
I noticed that pg_verify_checksum takes an "-o oid" argument to only check the relation with that OID; but that's wrong, because the number is a relfilenode, not an OID (since it's compared to the on-disk file name). I would suggest changing everything to clarify that it's a pg_class.relfilenode

Re: Online enabling of checksums

2018-02-28 Thread Robert Haas
On Sun, Feb 25, 2018 at 9:54 AM, Magnus Hagander wrote: > Also if that wasn't clear -- we only do the full page write if there isn't > already a checksum on the page and that checksum is correct. Hmm. Suppose that on the master there is a checksum on the page and that

Re: Online enabling of checksums

2018-02-27 Thread Daniel Gustafsson
> On 28 Feb 2018, at 00:51, Andrey Borodin wrote: > >> 25 февр. 2018 г., в 21:17, Magnus Hagander написал(а): >> >> PFA an updated patch that adds this, and also fixes the problem in >> pg_verify_checksums spotted by Michael Banck. > > I had to

Re: Online enabling of checksums

2018-02-27 Thread Andrey Borodin
Hi, Magus! > 25 февр. 2018 г., в 21:17, Magnus Hagander написал(а): > > PFA an updated patch that adds this, and also fixes the problem in > pg_verify_checksums spotted by Michael Banck. I had to ALLOW_CONNECTIONS to template0 to make it work postgres=# 2018-02-27

Re: Online enabling of checksums

2018-02-25 Thread Daniel Gustafsson
> On 26 Feb 2018, at 05:48, Tomas Vondra wrote: > On 02/24/2018 10:45 PM, Magnus Hagander wrote: >> Is it really that invisible? Given how much we argue over adding >> single counters to the stats system, I'm not sure it's quite that >> low. > > I'm a bit unsure

Re: Online enabling of checksums

2018-02-25 Thread Tomas Vondra
On 02/24/2018 10:45 PM, Magnus Hagander wrote: > On Sat, Feb 24, 2018 at 1:34 AM, Robert Haas > wrote: > > On Thu, Feb 22, 2018 at 3:28 PM, Magnus Hagander > > wrote: > > I would

Re: Online enabling of checksums

2018-02-25 Thread Tomas Vondra
On 02/25/2018 03:57 PM, Magnus Hagander wrote: > > ... > >> > I very strongly doubg it's a "very noticeable operational problem". People >> > > don't restart their databases very often... Let's say it takes 2-3 weeks >> > to >> > > complete a run in a fairly large database. How many such large

Re: Online enabling of checksums

2018-02-25 Thread Tomas Vondra
On 02/24/2018 03:51 AM, Stephen Frost wrote: > Greetings, > > * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: >> On 02/24/2018 03:11 AM, Andres Freund wrote: >>> On 2018-02-24 03:07:28 +0100, Tomas Vondra wrote: I agree having to restart the whole operation after a crash is not

Re: Online enabling of checksums

2018-02-25 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 10:48 PM, Magnus Hagander wrote: > On Sat, Feb 24, 2018 at 4:29 AM, Tomas Vondra < > tomas.von...@2ndquadrant.com> wrote: > >> Hi, >> >> I see the patch also does throttling by calling vacuum_delay_point(). >> Being able to throttle the checksum

Re: Online enabling of checksums

2018-02-25 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 11:06 PM, Andres Freund wrote: > Hi, > > On 2018-02-24 22:56:57 +0100, Magnus Hagander wrote: > > On Sat, Feb 24, 2018 at 10:49 PM, Andres Freund > wrote: > > > > We did consider doing it at a per-table basis as well. But this is >

Re: Online enabling of checksums

2018-02-25 Thread Magnus Hagander
On Sun, Feb 25, 2018 at 1:21 AM, Greg Stark wrote: > > The change of the checksum state is WAL logged with a new xlog record. > All the buffers written by the background worker are forcibly enabled full > page writes to make sure the checksum is fully updated on the standby even >

Re: Online enabling of checksums

2018-02-24 Thread Greg Stark
> The change of the checksum state is WAL logged with a new xlog record. All > the buffers written by the background worker are forcibly enabled full page > writes to make sure the checksum is fully updated on the standby even if no > actual contents of the buffer changed. Hm. That doesn't

Re: Online enabling of checksums

2018-02-24 Thread Andres Freund
Hi, On 2018-02-24 22:56:57 +0100, Magnus Hagander wrote: > On Sat, Feb 24, 2018 at 10:49 PM, Andres Freund wrote: > > > We did consider doing it at a per-table basis as well. But this is also > > an > > > overhead that has to be paid forever, whereas the risk of having to

Re: Online enabling of checksums

2018-02-24 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 10:49 PM, Andres Freund wrote: > On 2018-02-24 22:45:09 +0100, Magnus Hagander wrote: > > Is it really that invisible? Given how much we argue over adding single > > counters to the stats system, I'm not sure it's quite that low. > > That's appears to

Re: Online enabling of checksums

2018-02-24 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 6:14 PM, Michael Banck wrote: > Hi, > > On Wed, Feb 21, 2018 at 09:53:31PM +0100, Magnus Hagander wrote: > > We’ve also included a small commandline tool, bin/pg_verify_checksums, > > that can be run against an offline cluster to validate all

Re: Online enabling of checksums

2018-02-24 Thread Andres Freund
On 2018-02-24 22:45:09 +0100, Magnus Hagander wrote: > Is it really that invisible? Given how much we argue over adding single > counters to the stats system, I'm not sure it's quite that low. That's appears to be entirely unrelated. The stats stuff is expensive because we currently have to

Re: Online enabling of checksums

2018-02-24 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 4:29 AM, Tomas Vondra wrote: > Hi, > > I see the patch also does throttling by calling vacuum_delay_point(). > Being able to throttle the checksum workers not to affect user activity > definitely seems like a useful feature, no complaints

Re: Online enabling of checksums

2018-02-24 Thread Magnus Hagander
On Sat, Feb 24, 2018 at 1:34 AM, Robert Haas wrote: > On Thu, Feb 22, 2018 at 3:28 PM, Magnus Hagander > wrote: > > I would prefer that yes. But having to re-read 9TB is still significantly > > better than not being able to turn on checksums at all

Re: Online enabling of checksums

2018-02-24 Thread Michael Banck
Hi, On Wed, Feb 21, 2018 at 09:53:31PM +0100, Magnus Hagander wrote: > We’ve also included a small commandline tool, bin/pg_verify_checksums, > that can be run against an offline cluster to validate all checksums. The way it is coded in the patch will make pg_verify_checksums fail for heap files

Re: Online enabling of checksums

2018-02-23 Thread Tomas Vondra
Hi, I see the patch also does throttling by calling vacuum_delay_point(). Being able to throttle the checksum workers not to affect user activity definitely seems like a useful feature, no complaints here. But perhaps binding it to vacuum_cost_limit/vacuum_cost_delay is not the best idea? I

Re: Online enabling of checksums

2018-02-23 Thread Stephen Frost
Greetings, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: > On 02/24/2018 03:11 AM, Andres Freund wrote: > > On 2018-02-24 03:07:28 +0100, Tomas Vondra wrote: > >> I agree having to restart the whole operation after a crash is not > >> ideal, but I don't see how adding a flag actually

Re: Online enabling of checksums

2018-02-23 Thread Tomas Vondra
On 02/24/2018 03:11 AM, Andres Freund wrote: > Hi, > > On 2018-02-24 03:07:28 +0100, Tomas Vondra wrote: >> I agree having to restart the whole operation after a crash is not >> ideal, but I don't see how adding a flag actually solves it. The problem >> is the large databases often store most

Re: Online enabling of checksums

2018-02-23 Thread Andres Freund
Hi, On 2018-02-24 03:07:28 +0100, Tomas Vondra wrote: > I agree having to restart the whole operation after a crash is not > ideal, but I don't see how adding a flag actually solves it. The problem > is the large databases often store most of the data (>80%) in one or two > central tables (think

Re: Online enabling of checksums

2018-02-23 Thread Tomas Vondra
On 02/24/2018 01:34 AM, Robert Haas wrote: > On Thu, Feb 22, 2018 at 3:28 PM, Magnus Hagander wrote: >> I would prefer that yes. But having to re-read 9TB is still significantly >> better than not being able to turn on checksums at all (state today). And >> adding a catalog

Re: Online enabling of checksums

2018-02-23 Thread Robert Haas
On Thu, Feb 22, 2018 at 3:28 PM, Magnus Hagander wrote: > I would prefer that yes. But having to re-read 9TB is still significantly > better than not being able to turn on checksums at all (state today). And > adding a catalog column for it will carry the cost of the

Re: Online enabling of checksums

2018-02-23 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 9:09 PM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2/22/18 12:38, Magnus Hagander wrote: > > I'm not entirely sure which the others ones are. Auto-Vacuum obviously > > is one, which doesn't use the worker infrastructure. But I'm not sure > > which

Re: Online enabling of checksums

2018-02-23 Thread Robert Haas
On Thu, Feb 22, 2018 at 9:48 PM, Michael Paquier wrote: > On Thu, Feb 22, 2018 at 11:24:37AM -0800, Andres Freund wrote: >> I suspect I'm going to get some grief for this, but I think the time has >> come to bite the bullet and support changing databases in the same >>

Re: Online enabling of checksums

2018-02-22 Thread Andres Freund
How does: On 2018-02-23 11:48:16 +0900, Michael Paquier wrote: > On Thu, Feb 22, 2018 at 11:24:37AM -0800, Andres Freund wrote: > > I suspect I'm going to get some grief for this, but I think the time has > > come to bite the bullet and support changing databases in the same > > process... > >

Re: Online enabling of checksums

2018-02-22 Thread Michael Paquier
On Thu, Feb 22, 2018 at 11:24:37AM -0800, Andres Freund wrote: > I suspect I'm going to get some grief for this, but I think the time has > come to bite the bullet and support changing databases in the same > process... I'd like to see that. Last time this has been discussed, and Robert

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 9:23 PM, Andres Freund wrote: > Hi, > > On 2018-02-22 21:16:02 +0100, Magnus Hagander wrote: > > You could do that, but then you've moving the complexity to managing that > > list in shared memory instead. > > Maybe I'm missing something, but how are

Re: Online enabling of checksums

2018-02-22 Thread Andres Freund
Hi, On 2018-02-22 21:16:02 +0100, Magnus Hagander wrote: > You could do that, but then you've moving the complexity to managing that > list in shared memory instead. Maybe I'm missing something, but how are you going to get quick parallel processing if you don't have a shmem piece? You can't

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 8:52 PM, Andres Freund wrote: > > > On February 22, 2018 11:44:17 AM PST, Magnus Hagander > wrote: > >On Thu, Feb 22, 2018 at 8:41 PM, Andres Freund > >wrote: > >In this particular case that would at least

Re: Online enabling of checksums

2018-02-22 Thread Peter Eisentraut
On 2/22/18 12:38, Magnus Hagander wrote: > I'm not entirely sure which the others ones are. Auto-Vacuum obviously > is one, which doesn't use the worker infrastructure. But I'm not sure > which the others are referring to?  autovacuum, subscription workers, auto prewarm -- Peter Eisentraut

Re: Online enabling of checksums

2018-02-22 Thread Andres Freund
On February 22, 2018 11:44:17 AM PST, Magnus Hagander wrote: >On Thu, Feb 22, 2018 at 8:41 PM, Andres Freund >wrote: >In this particular case that would at least phase 1 simplify it because >we'd only need one process instead of worker/launcher.

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 8:41 PM, Andres Freund wrote: > > On 2018-02-22 20:30:52 +0100, Magnus Hagander wrote: > > On Thu, Feb 22, 2018 at 8:24 PM, Andres Freund > wrote: > > > I suspect I'm going to get some grief for this, but I think the time > has > >

Re: Online enabling of checksums

2018-02-22 Thread Andres Freund
Hi, On 2018-02-22 20:30:52 +0100, Magnus Hagander wrote: > On Thu, Feb 22, 2018 at 8:24 PM, Andres Freund wrote: > > I suspect I'm going to get some grief for this, but I think the time has > > come to bite the bullet and support changing databases in the same > > process...

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 8:24 PM, Andres Freund wrote: > On 2018-02-22 08:22:48 -0500, Peter Eisentraut wrote: > > On 2/21/18 15:53, Magnus Hagander wrote: > > > *Two new functions are added, pg_enable_data_checksums() and > > > pg_disable_data_checksums(). The disable one is

Re: Online enabling of checksums

2018-02-22 Thread Andres Freund
On 2018-02-22 08:22:48 -0500, Peter Eisentraut wrote: > On 2/21/18 15:53, Magnus Hagander wrote: > > *Two new functions are added, pg_enable_data_checksums() and > > pg_disable_data_checksums(). The disable one is easy -- it just changes > > to disable. The enable one will change the state to

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
On Thu, Feb 22, 2018 at 4:47 PM, Andrey Borodin wrote: > Hello, Magnus, Peter! > > I'm excited that this feature emerged, thanks for the patch. Hope it will > help to fix some mistakes made during initdb long time ago... > > 22 февр. 2018 г., в 18:22, Peter Eisentraut

Re: Online enabling of checksums

2018-02-22 Thread Andrey Borodin
Hello, Magnus, Peter! I'm excited that this feature emerged, thanks for the patch. Hope it will help to fix some mistakes made during initdb long time ago... > 22 февр. 2018 г., в 18:22, Peter Eisentraut > написал(а): > > On 2/21/18 15:53, Magnus Hagander

Re: Online enabling of checksums

2018-02-22 Thread Peter Eisentraut
On 2/21/18 15:53, Magnus Hagander wrote: > *Two new functions are added, pg_enable_data_checksums() and > pg_disable_data_checksums(). The disable one is easy -- it just changes > to disable. The enable one will change the state to inprogress, and then > start a background worker (the

Re: Online enabling of checksums

2018-02-22 Thread Magnus Hagander
Re-sending this one with proper formatting. Apologies for the horrible gmail-screws-up-the-text-part of the last one! No change to patch or text, just the formatting. //Magnus Once more, here is an attempt to solve the problem of on-line enabling of checksums that me and Daniel have been

<    1   2