summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_cursor.c20
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_page.c18
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_meta.c9
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c1
-rw-r--r--src/third_party/wiredtiger/src/utilities/util_main.c2
5 files changed, 27 insertions, 23 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c
index 6e90447f18d..8c7170e6180 100644
--- a/src/third_party/wiredtiger/src/btree/bt_cursor.c
+++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c
@@ -1067,13 +1067,6 @@ err: if (ret == WT_RESTART) {
goto retry;
}
- /*
- * If the cursor is configured to overwrite and the record is not found,
- * that is exactly what we want, return success.
- */
- if (F_ISSET(cursor, WT_CURSTD_OVERWRITE) && ret == WT_NOTFOUND)
- ret = 0;
-
done: if (ret == 0) {
F_CLR(cursor, WT_CURSTD_VALUE_SET);
switch (positioned) {
@@ -1104,6 +1097,19 @@ done: if (ret == 0) {
if (ret != 0) {
WT_TRET(__cursor_reset(cbt));
__cursor_state_restore(cursor, &state);
+
+ /*
+ * If the cursor is configured to overwrite and the record isn't
+ * found, that is exactly what we want, return success. Note we
+ * set clear the return value after everything else, the clause
+ * above dealing with the cursor position is only correct if we
+ * were successful. If search failed after positioned is set to
+ * SEARCH_POSITION, we cannot return a key. The only action to
+ * take is to set the cursor to its original key, which we just
+ * did.
+ */
+ if (F_ISSET(cursor, WT_CURSTD_OVERWRITE) && ret == WT_NOTFOUND)
+ ret = 0;
}
return (ret);
diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c
index 0ff314f3484..6d904a2004b 100644
--- a/src/third_party/wiredtiger/src/evict/evict_page.c
+++ b/src/third_party/wiredtiger/src/evict/evict_page.c
@@ -306,16 +306,14 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
switch (mod->rec_result) {
case WT_PM_REC_EMPTY: /* Page is empty */
/*
- * Update the parent to reference a deleted page. The fact that
- * reconciliation left the page "empty" means there's no older
- * transaction in the system that might need to see an earlier
- * version of the page. For that reason, we clear the address
- * of the page, if we're forced to "read" into that namespace,
- * we'll instantiate a new page instead of trying to read from
- * the backing store.
+ * Update the parent to reference a deleted page. Reconciliation
+ * left the page "empty", so there's no older transaction in the
+ * system that might need to see an earlier version of the page.
+ * There's no backing address, if we're forced to "read" into
+ * that namespace, we instantiate a new page instead of trying
+ * to read from the backing store.
*/
__wt_ref_out(session, ref);
- ref->addr = NULL;
WT_WITH_PAGE_INDEX(session,
ret = __evict_delete_ref(session, ref, closing));
WT_RET_BUSY_OK(ret);
@@ -354,9 +352,7 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
* Publish: a barrier to ensure the structure fields are set
* before the state change makes the page available to readers.
*/
- if (mod->mod_replace.addr == NULL)
- ref->addr = NULL;
- else {
+ if (mod->mod_replace.addr != NULL) {
WT_RET(__wt_calloc_one(session, &addr));
*addr = mod->mod_replace;
mod->mod_replace.addr = NULL;
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_meta.c b/src/third_party/wiredtiger/src/lsm/lsm_meta.c
index 88daca989a6..de12f19380b 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_meta.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_meta.c
@@ -201,9 +201,12 @@ __lsm_meta_read_v1(
cv.str, cv.len, &lsm_tree->collator_name));
}
- WT_ERR(__wt_config_getones(
- session, lsmconf, "lsm.merge_custom.start_generation", &cv));
- lsm_tree->custom_generation = (uint32_t)cv.val;
+ /* lsm.merge_custom does not appear in all V1 LSM metadata. */
+ lsm_tree->custom_generation = 0;
+ if ((ret = __wt_config_getones(
+ session, lsmconf, "lsm.merge_custom.start_generation", &cv)) == 0)
+ lsm_tree->custom_generation = (uint32_t)cv.val;
+ WT_ERR_NOTFOUND_OK(ret);
if (lsm_tree->custom_generation != 0) {
WT_ERR(__wt_config_getones(
session, lsmconf, "lsm.merge_custom.prefix", &cv));
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index 3ad6bdf41ea..d9b415a76cd 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -1347,7 +1347,6 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
(F_ISSET(r, WT_REC_VISIBLE_ALL) ?
WT_TXNID_LE(r->last_running, txnid) :
!__txn_visible_id(session, txnid))) {
- WT_ASSERT(session, upd->type != WT_UPDATE_BIRTHMARK);
uncommitted = r->update_uncommitted = true;
continue;
}
diff --git a/src/third_party/wiredtiger/src/utilities/util_main.c b/src/third_party/wiredtiger/src/utilities/util_main.c
index fb9fb433892..2d08c4c5274 100644
--- a/src/third_party/wiredtiger/src/utilities/util_main.c
+++ b/src/third_party/wiredtiger/src/utilities/util_main.c
@@ -41,7 +41,7 @@ usage(void)
"\t" "compact\t compact an object\n"
"\t" "copyright copyright information\n"
"\t" "create\t create an object\n"
- "\t" "downgrade\t downgrade an database\n"
+ "\t" "downgrade downgrade a database\n"
"\t" "drop\t drop an object\n"
"\t" "dump\t dump an object\n"
"\t" "list\t list database objects\n"