Re: Bug #613: Sequence values fall back to previously checkpointed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ben Grimm <bgrimm(at)zaeon(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org, Vadim Mikheev <vmikheev(at)sectorbase(dot)com>
Subject: Re: Bug #613: Sequence values fall back to previously checkpointed
Date: 2002-03-13 19:39:37
Message-ID: 10283.1016048377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ben Grimm <bgrimm(at)zaeon(dot)com> writes:
> It seems like you just need to ensure that when the sequence is loaded
> from disk that log_cnt gets updated and written back to disk before the
> sequence is used. I'm not sure of the impact, but I can't reproduce the
> bugs after making these changes. I just added a flag to the SeqTableData
> struct to say whether its been logged yet - this seems like overkill..
> but it works for me :-) (at least in the scenarios I've tried)

I don't think that can work. AFAICT what your patch does is to ensure
a WAL record is written by the first nextval() in any given backend
session. But what we need is to ensure a WAL record from the first
nextval() after a checkpoint. The failure cases for your patch would
involve backends that have been running for longer than one checkpoint
cycle ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Per Winkvist 2002-03-13 20:10:03 Case sensitive table names ?
Previous Message Ward Vandewege 2002-03-13 16:47:22 SERIAL silently trunctates sequence name to 31 characters