Re: Online enabling of checksums - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Online enabling of checksums
Date
Msg-id CABUevEyRsAUOTVqQ8PvCAOHd+0foKTwRq34QD3LuGVLa0ydHLg@mail.gmail.com
Whole thread Raw
In response to Re: Online enabling of checksums  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: Online enabling of checksums  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On Mon, Mar 26, 2018 at 10:09 PM, Tomas Vondra <tomas.vondra@2ndquadrant.com> 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 (no limit), just like for vacuum_cost?


Eh. vaccum_cost_limit cannot be set to -1 (1 is the lowest). Neither can vacuum_cost_delay -- it is set to *0* to disable it (which is how the cost_delay parameter is handled here as well).

Are you thinking autovacuum_vacuum_cost_limit where -1 means "use vacuum_cost_limit"?

The reason to disallow cost_limit=0 is to avoid divide-by-zero. We could allow -1 and have it mean "use vacuum_cost_limit", but I'm not sure how relevant that really would be in this context?

--

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types
Next
From: Magnus Hagander
Date:
Subject: Re: Parallel Aggregates for string_agg and array_agg