Re: WAL-based allocation of XIDs is insecure

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WAL-based allocation of XIDs is insecure
Дата
Msg-id 20451.983822556@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WAL-based allocation of XIDs is insecure  (Ian Lance Taylor <ian@airs.com>)
Список pgsql-hackers
Ian Lance Taylor <ian@airs.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.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to handle waitingForLock in LockWaitCancel()
Следующее
От: Ian Lance Taylor
Дата:
Сообщение: Re: WAL-based allocation of XIDs is insecure