MultiXactID Wrap-Around

From: paolo romano <paolo(dot)romano(at)yahoo(dot)it>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: MultiXactID Wrap-Around
Date: 2006-07-03 13:45:25
Message-ID: 20060703134525.86528.qmail@web27808.mail.ukl.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

ops, i did forget to update the e-mail subject, sorry. I am reposting it with an appropriate one.

-------------------------------------------------------------------------------- I'm keeping on studying multixact.c and log management, and I hope you can help me, as usual, in clearing my doubts.

My doubts now concern MultixactID wrap-around management.
Afaics, it is possible to spawn multixactids so quickly to have a wrap-around and to start overwriting the data stored in the offset slru (but analogous considerations apply to the member slru as well). This would cause corruption, if the overwritten info was still needed, e.g., by a (very) long-running transaction. This is of course very unlikely in practice, but yet still possible in theory.

In GetNewMultiXactId () wrap-around of MultiXactId seems to be simply handled this way:

00780 _/* Handle wraparound of the nextMXact counter */
00781 if (MultiXactState->nextMXact < FirstMultiXactId)
00782 MultiXactState->nextMXact = FirstMultiXactId;

I cannot see how this may avoid possible overwriting of still needed data. To address such an issue shouldn't one need to check against OldestMemberMXactId, OldestVisibleMXactId? Or, alternatively, rely on an approach similar to the one taken to handle standard XID generation (xidWarnLimit, see GetNewTransactionId)?

Is it me who's missing something or is it just that such a case has been considered so unlikely not to motivate additional overheads/checks?

Thanks in advance!

Paolo

Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2006-07-03 13:58:06 Re: MultiXactID Wrap-Around
Previous Message User Fxjr 2006-07-03 13:10:53 npgsql - Npgsql: 2006-07-03 Francisco Figueiredo Jr.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-07-03 13:58:06 Re: MultiXactID Wrap-Around
Previous Message Mark Woodward 2006-07-03 13:28:48 update/insert, delete/insert efficiency WRT vacuum and MVCC