Skip site navigation (1) Skip section navigation (2)

Re: WAL-based allocation of XIDs is insecure

From: Ian Lance Taylor <ian(at)airs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WAL-based allocation of XIDs is insecure
Date: 2001-03-05 20:07:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Ian Lance Taylor <ian(at)airs(dot)com> writes:
> > I think your example demonstrates something slightly different.  I
> > think it demonstrates that Postgres must flush the XLOG entry to disk
> > before it flushes any buffer to disk which uses an XID which was just
> > allocated.
> That would be an alternative solution, but it's considerably more
> complex to implement and I'm not convinced it is more efficient.
> The above could result, worst case, in double the normal number of
> fsyncs --- each new transaction might need an fsync to dump its first
> few XLOG records (in addition to the fsync for its commit), if the
> shmem disk buffer traffic is not in your favor.  This worst case is
> not even difficult to produce: consider a series of standalone
> transactions that each touch more than -B pages (-B = # of buffers).
> In contrast, syncing NEXTXID records will require exactly one extra
> fsync every few thousand transactions.  That seems quite acceptable
> to me, and better than an fsync load that we can't predict.  Perhaps
> the average case of fsync-on-buffer-flush would be better than that,
> or perhaps not, but the worst case is definitely far worse.

I described myself unclearly.  I was suggesting an addition to what
you are suggesting.  The worst case can not be worse.

If you are going to allocate a few thousand XIDs each time, then I
agree that my suggested addition is not worth it.  But how do you deal
with XID wraparound on an unstable system?


In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2001-03-05 20:15:40
Subject: Re: WAL-based allocation of XIDs is insecure
Previous:From: Tom LaneDate: 2001-03-05 20:02:36
Subject: Re: WAL-based allocation of XIDs is insecure

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group