From: Mason Sharp Date: Mon, 2 May 2016 18:44:53 +0000 (-0400) Subject: It may happen that we try to read the status of a transaction X-Git-Tag: XL9_5_R1_1~16 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d3356cd451664f3585706f0ae817e0037814ec6e;p=postgres-xl.git It may happen that we try to read the status of a transaction in clog before the page has been committed. There are places in the code that try to extend clog, but here we simply just do one retry if it looks like we failed to read the desired page. --- diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 89c56a1b78..bf19338c12 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -410,6 +410,17 @@ SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok, /* Do the read */ ok = SlruPhysicalReadPage(ctl, pageno, slotno); + /* + * If we failed, it may be because we tried to read the status + * before the page was created. Retry once + */ + if (!ok && slru_errcause == SLRU_READ_FAILED) + { + ExtendLogs(xid); + /* Retry */ + ok = SlruPhysicalReadPage(ctl, pageno, slotno); + } + /* Set the LSNs for this newly read-in page to zero */ SimpleLruZeroLSNs(ctl, slotno);