diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_discard.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_discard.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_discard.c b/src/third_party/wiredtiger/src/btree/bt_discard.c index fcabc73ac45..302dc95fd97 100644 --- a/src/third_party/wiredtiger/src/btree/bt_discard.c +++ b/src/third_party/wiredtiger/src/btree/bt_discard.c @@ -165,6 +165,13 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page) break; } __wt_free(session, multi->supd); + /* + * Discard the new disk images if they are not NULL. If the new disk images are NULL, + * they must have been instantiated into memory. Otherwise, we have a failure in + * eviction after reconciliation. If the split code only successfully instantiates a + * subset of new pages into memory, free the instantiated pages and the new disk images + * of the pages not in memory. We will redo reconciliation next time we visit this page. + */ __wt_free(session, multi->disk_image); __wt_free(session, multi->addr.addr); } @@ -174,8 +181,16 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page) /* * Discard any replacement address: this memory is usually moved into the parent's WT_REF, * but at the root that can't happen. + * + * Discard the new disk image if it is not NULL. If the new disk image is NULL, it must have + * been instantiated into memory. Otherwise, we have a failure in eviction after + * reconciliation and later we decide to discard the old disk image without loading the new + * disk image into memory. Free the new disk image in this case. If a checkpoint visits this + * page, it would write the new disk image even it hasn't been instantiated into memory. + * Therefore, no need to reconcile the page again if it remains clean. */ __wt_free(session, mod->mod_replace.addr); + __wt_free(session, mod->mod_disk_image); break; } |