summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-02-28 17:11:36 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-02-28 17:11:36 +1100
commitf3cf9e7cec7268b1f84001b1fb75ab83f2ccc5ca (patch)
treefc1f2abd39bf0764bb413aaaf59d592a5155f76a
parent2d0287ff3956123a933a0928c271ce3941a77a48 (diff)
downloadmongo-f3cf9e7cec7268b1f84001b1fb75ab83f2ccc5ca.tar.gz
Add comments explaining the reconciliation transactional read logic, including when pages become clean.
-rw-r--r--src/include/txn.i17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/include/txn.i b/src/include/txn.i
index 0c51751ccd2..2543d5ff21f 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -166,8 +166,9 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id)
/*
* __wt_txn_read_skip --
- * Get the first visible update in a list (or NULL if none are visible),
- * and report whether there are an uncommitted changes in the list.
+ * Get the first visible update in a list (or NULL if none are visible).
+ * Report the maximum transaction ID in the list and whether any updates
+ * were skipped to find the visible update.
*/
static inline WT_UPDATE *
__wt_txn_read_skip(
@@ -175,6 +176,18 @@ __wt_txn_read_skip(
{
WT_UPDATE *first_upd;
+ /*
+ * Track the largest transaction ID on this page. We store this in the
+ * page at the end of reconciliation if no updates are skipped. It is
+ * used to avoid evicting a clean page from memory with changes that
+ * are required to satisfy a snapshot read.
+ *
+ * Record whether any updates were skipped on the way to finding the
+ * first visible update. That determines whether a future read with no
+ * intervening modifications to the page could see a different value.
+ * If not, the page can safely be marked clean, and does not need to be
+ * reconciled until it is modified again.
+ */
*skipp = 0;
for (first_upd = NULL; upd != NULL; upd = upd->next)
if (upd->txnid != WT_TXN_ABORTED) {