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!


Chiacchiera con i tuoi amici in tempo reale!

Reply via email to