Blame SOURCES/checkpoint-opd-deadlock.patch

c7d609
--- db-5.3.21/src/db/db_cam.c.opd_deadlock	2017-10-31 12:20:54.118979690 +0100
c7d609
+++ db-5.3.21/src/db/db_cam.c	2017-10-31 12:21:06.828739341 +0100
c7d609
@@ -868,6 +868,11 @@
c7d609
 	    flags == DB_PREV || flags == DB_PREV_DUP)) {
c7d609
 		if (tmp_rmw && (ret = dbc->am_writelock(dbc)) != 0)
c7d609
 			goto err;
c7d609
+        /* Latch the primary tree page here in order to not deadlock later. */
c7d609
+		if (cp->page == NULL &&
c7d609
+		    (ret = __memp_fget(mpf, &cp->pgno,
c7d609
+			 dbc->thread_info, dbc->txn, 0, &cp->page)) != 0)
c7d609
+			goto err;
c7d609
 		if (F_ISSET(dbc, DBC_TRANSIENT))
c7d609
 			opd = cp->opd;
c7d609
 		else if ((ret = __dbc_idup(cp->opd, &opd, DB_POSITION)) != 0)