summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Sharp2010-08-23 04:24:57 +0000
committerPavan Deolasee2011-05-19 16:45:15 +0000
commit9c0eff0f586b5d02822e18ad70bdf2370bddfbe2 (patch)
treee631af50d0347db225b9f423acce59d1741babac
parentdb8408c3637a9af6fa36a7a90513a261076a1e46 (diff)
In Postgres-XC, when extedngin the clog the status assertion
occasionally fails when under a very heavy for long tests. We break the two assertions out and make the second one this a warning instead of an assertion for now.
-rw-r--r--src/backend/access/transam/slru.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index 5bf91c8aa5..d14ae9e206 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -555,8 +555,22 @@ SimpleLruWritePage(SlruCtl ctl, int slotno, SlruFlush fdata)
/* Re-acquire control lock and update page state */
LWLockAcquire(shared->ControlLock, LW_EXCLUSIVE);
+#ifdef PGXC
+ /*
+ * In Postgres-XC the status assertion occasionally fails when
+ * under a very heavy for long tests.
+ * We break the two assertions out and make the second one
+ * this a warning instead of an assertion for now.
+ */
+ Assert(shared->page_number[slotno] == pageno);
+
+ if (shared->page_status[slotno] != SLRU_PAGE_WRITE_IN_PROGRESS)
+ elog(WARNING, "Unexpected page status in SimpleLruWritePage(), status = %d, was expecting 3 (SLRU_PAGE_WRITE_IN_PROGRESS) for page %d",
+ shared->page_status[slotno], shared->page_number[slotno]);
+#else
Assert(shared->page_number[slotno] == pageno &&
shared->page_status[slotno] == SLRU_PAGE_WRITE_IN_PROGRESS);
+#endif
/* If we failed to write, mark the page dirty again */
if (!ok)