On Wed, Dec 6, 2017 at 11:26 PM, Andres Freund <and...@anarazel.de> wrote: > >> Either way, it is not clear to me how we will keep it >> updated after recovery. Right now, the mechanism is quite simple, at >> the beginning of a recovery we take the value of nextXid from >> checkpoint record and then if any xlog record indicates xid that >> follows nextXid, we advance it. Here, the point to note is that we >> take the xid from the WAL record (which means that it assumes xids are >> non-contiguous or some xids are consumed without being logged) and >> increment it. Unless we plan to change something in that logic (like >> storing 64-bit xids in WAL records), it is not clear to me how to make >> it work. OTOH, recovering value of epoch which increments only at >> wraparound seems fairly straightforward as described in my previous >> email. > > I think it should be fairly simple if simply add the 64bit xid to the > existing clog extension WAL records. >
IIUC, you mean to say that we should log the 64bit xid value in CLOG_ZEROPAGE record while extending clog and that too we can do only at wraparound. Now, maybe doing it every time also doesn't hurt, but I think doing it at wraparound should be sufficient. Just to be clear, I am not planning to pursue writing a patch for this at the moment. So, if anybody else is interested or if Andres wants to write it, I can help in the review. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com