Re: sequences vs. synchronous replication

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: sequences vs. synchronous replication
Date: 2021-12-28 01:39:51
Message-ID: 29ff7c1c-fdd2-d932-9146-7f372f9eae87@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/27/21 21:24, Peter Eisentraut wrote:
> On 24.12.21 09:04, Kyotaro Horiguchi wrote:
>> Still, as Fujii-san concerns, I'm afraid that some people may suffer
>> the degradation the patch causes.  I wonder it is acceptable to get
>> back the previous behavior by exposing SEQ_LOG_VALS itself or a
>> boolean to do that, as a 'not-recommended-to-use' variable.
>
> There is also the possibility of unlogged sequences if you want to avoid
> the WAL logging and get higher performance.

But unlogged sequences are not supported:

test=# create unlogged sequence s;
ERROR: unlogged sequences are not supported

And even if we did, what would be the behavior after crash? For tables
we discard the contents, so for sequences we'd probably discard it too
and start from scratch? That doesn't seem particularly useful.

We could also write / fsync the sequence buffer, but that has other
downsides. But that's not implemented either, and it's certainly out of
scope for this patch.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-12-28 02:15:23 Can there ever be out of sequence WAL files?
Previous Message SATYANARAYANA NARLAPURAM 2021-12-28 00:40:28 Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes