summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2016-09-09 15:49:31 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-09-09 15:58:39 +1000
commit29b5a329c5c72fe87d1627bd99e682d9d5e2e34c (patch)
tree1dc8949286121eb16b472d4f5e4ea391baebc5de /src/third_party/wiredtiger/src/reconcile
parentbda317e9c852b27f0fe7d148e5c08499d2f8ec49 (diff)
downloadmongo-29b5a329c5c72fe87d1627bd99e682d9d5e2e34c.tar.gz
Import wiredtiger: 569c70d13a7b3da0fe8eb1bac06a86865cb36a7c from branch mongodb-3.4
ref: 7d3c0f9f50..569c70d13a for: 3.3.13 SERVER-25843 Coverity analysis defect 99856: Redundant test SERVER-25845 Coverity analysis defect 99859: Explicit null dereferenced SERVER-25846 Coverity analysis defect 99861: Dereference after null check WT-2221 Document which statistics are available via a "fast" configuration vs. an "all" configuration WT-2233 Investigate changing when the eviction server switches to aggressive mode. WT-2323 Allocate a transaction id at the beginning of join cursor iteration WT-2555 make format run on Windows WT-2788 Java: freed memory overwrite during handle close can cause JNI crash WT-2816 Improve WiredTiger eviction performance WT-2824 wtperf displays connection and table create configurations twice WT-2842 split wtperf's configuration into per-database and per-run parts WT-2866 Eviction server algorithm tuning WT-2867 Review and fix barrier usage in __lsm_tree_close WT-2870 Rename wtperf checkpoint schema jobs WT-2871 __wt_verbose has the wrong GCC format attributes WT-2872 Recent stuck cache test/stress failures. WT-2873 Refactor CRC32 code WT-2875 Test test_wt2853_perf can run too long under valgrind WT-2876 Extend wtperf to support a log like table WT-2878 Verbose changes affected performance WT-2881 Add -Wpedantic to clang compiler warning flags WT-2882 Add CRC32 hardware scons detection, disable CRC hardware support on ARM for now WT-2883 wiredtiger_open with verbose=handleops recursive loop WT-2885 __wt_checkpoint_signal lint WT-2886 Decide how in-memory configuration and eviction_dirty_target interact WT-2888 Switch functions to return void where possible WT-2892 hot backup can race with block truncate WT-2896 Coverity #1362535: resource leak WT-2897 Checkpoints can become corrupted on failure WT-2901 Add option to disable checkpoint dirty stepdown phase
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_track.c12
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c30
2 files changed, 23 insertions, 19 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_track.c b/src/third_party/wiredtiger/src/reconcile/rec_track.c
index 1515550deda..10a64fdf116 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_track.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_track.c
@@ -46,7 +46,7 @@ __ovfl_discard_verbose(
"discard: %s%s%p %s",
tag == NULL ? "" : tag,
tag == NULL ? "" : ": ",
- page,
+ (void *)page,
__wt_addr_string(session, unpack->data, unpack->size, tmp));
__wt_scr_free(session, &tmp);
@@ -108,7 +108,7 @@ __ovfl_discard_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page)
* __ovfl_discard_wrapup_err --
* Resolve the page's overflow discard list after an error occurs.
*/
-static int
+static void
__ovfl_discard_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page)
{
WT_OVFL_TRACK *track;
@@ -117,8 +117,6 @@ __ovfl_discard_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page)
__wt_free(session, track->discard);
track->discard_entries = track->discard_allocated = 0;
-
- return (0);
}
/*
@@ -180,7 +178,7 @@ __ovfl_reuse_verbose(WT_SESSION_IMPL *session,
"reuse: %s%s%p %s (%s%s%s) {%.*s}",
tag == NULL ? "" : tag,
tag == NULL ? "" : ": ",
- page,
+ (void *)page,
__wt_addr_string(
session, WT_OVFL_REUSE_ADDR(reuse), reuse->addr_size, tmp),
F_ISSET(reuse, WT_OVFL_REUSE_INUSE) ? "inuse" : "",
@@ -578,7 +576,7 @@ __ovfl_txnc_verbose(WT_SESSION_IMPL *session,
"txn-cache: %s%s%p %s %" PRIu64 " {%.*s}",
tag == NULL ? "" : tag,
tag == NULL ? "" : ": ",
- page,
+ (void *)page,
__wt_addr_string(
session, WT_OVFL_TXNC_ADDR(txnc), txnc->addr_size, tmp),
txnc->current,
@@ -903,7 +901,7 @@ __wt_ovfl_track_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page)
track = page->modify->ovfl_track;
if (track->discard != NULL)
- WT_RET(__ovfl_discard_wrapup_err(session, page));
+ __ovfl_discard_wrapup_err(session, page);
if (track->ovfl_reuse[0] != NULL)
WT_RET(__ovfl_reuse_wrapup_err(session, page));
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index 9c742476910..a9912628942 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -159,7 +159,7 @@ typedef struct {
WT_ADDR addr; /* Split's written location */
uint32_t size; /* Split's size */
- uint32_t cksum; /* Split's checksum */
+ uint32_t checksum; /* Split's checksum */
void *disk_image; /* Split's disk image */
@@ -374,14 +374,19 @@ __wt_reconcile(WT_SESSION_IMPL *session,
*/
__wt_writelock(session, &page->page_lock);
+ oldest_id = __wt_txn_oldest_id(session);
+ if (LF_ISSET(WT_EVICTING))
+ mod->last_eviction_id = oldest_id;
+
+#ifdef HAVE_DIAGNOSTIC
/*
* Check that transaction time always moves forward for a given page.
* If this check fails, reconciliation can free something that a future
* reconciliation will need.
*/
- oldest_id = __wt_txn_oldest_id(session);
WT_ASSERT(session, WT_TXNID_LE(mod->last_oldest_id, oldest_id));
mod->last_oldest_id = oldest_id;
+#endif
/* Initialize the reconciliation structure for each new run. */
if ((ret = __rec_write_init(
@@ -1872,7 +1877,7 @@ __rec_split_bnd_init(WT_SESSION_IMPL *session, WT_BOUNDARY *bnd)
__wt_free(session, bnd->addr.addr);
WT_CLEAR(bnd->addr);
bnd->size = 0;
- bnd->cksum = 0;
+ bnd->checksum = 0;
__wt_free(session, bnd->disk_image);
@@ -3195,7 +3200,7 @@ __rec_split_write(WT_SESSION_IMPL *session,
WT_ILLEGAL_VALUE(session);
}
bnd->size = (uint32_t)buf->size;
- bnd->cksum = 0;
+ bnd->checksum = 0;
/*
* Check if we've saved updates that belong to this block, and move
@@ -3301,7 +3306,7 @@ supd_check_complete:
*/
dsk->write_gen = 0;
memset(WT_BLOCK_HEADER_REF(dsk), 0, btree->block_header);
- bnd->cksum = __wt_cksum(buf->data, buf->size);
+ bnd->checksum = __wt_checksum(buf->data, buf->size);
/*
* One last check: don't reuse blocks if compacting, the reason
@@ -3314,7 +3319,7 @@ supd_check_complete:
mod->mod_multi_entries > bnd_slot) {
multi = &mod->mod_multi[bnd_slot];
if (multi->size == bnd->size &&
- multi->cksum == bnd->cksum) {
+ multi->checksum == bnd->checksum) {
multi->addr.reuse = 1;
bnd->addr = multi->addr;
@@ -3329,7 +3334,7 @@ supd_check_complete:
if (WT_VERBOSE_ISSET(session, WT_VERB_SPLIT) && r->entries < 6)
__wt_verbose(session, WT_VERB_SPLIT,
"Reconciliation creating a page with %" PRIu32
- " entries, memory footprint %" PRIu64
+ " entries, memory footprint %" WT_SIZET_FMT
", page count %" PRIu32 ", %s, split state: %d\n",
r->entries, r->page->memory_footprint, r->bnd_next,
F_ISSET(r, WT_EVICTING) ? "evict" : "checkpoint",
@@ -3406,7 +3411,7 @@ __rec_update_las(WT_SESSION_IMPL *session,
*/
__wt_las_set_written(session);
- WT_ERR(__wt_las_cursor(session, &cursor, &session_flags));
+ __wt_las_cursor(session, &cursor, &session_flags);
/* Ensure enough room for a column-store key without checking. */
WT_ERR(__wt_scr_alloc(session, WT_INTPACK64_MAXSIZE, &key));
@@ -5637,7 +5642,8 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
switch (r->bnd_next) {
case 0: /* Page delete */
- __wt_verbose(session, WT_VERB_RECONCILE, "page %p empty", page);
+ __wt_verbose(
+ session, WT_VERB_RECONCILE, "page %p empty", (void *)page);
WT_STAT_FAST_CONN_INCR(session, rec_page_delete);
WT_STAT_FAST_DATA_INCR(session, rec_page_delete);
@@ -5699,7 +5705,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
default: /* Page split */
__wt_verbose(session, WT_VERB_RECONCILE,
"page %p reconciled into %" PRIu32 " pages",
- page, r->bnd_next);
+ (void *)page, r->bnd_next);
switch (page->type) {
case WT_PAGE_COL_INT:
@@ -5844,7 +5850,7 @@ __rec_split_row(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
multi->addr = bnd->addr;
multi->addr.reuse = 0;
multi->size = bnd->size;
- multi->cksum = bnd->cksum;
+ multi->checksum = bnd->checksum;
bnd->addr.addr = NULL;
}
mod->mod_multi_entries = r->bnd_next;
@@ -5891,7 +5897,7 @@ __rec_split_col(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
multi->addr = bnd->addr;
multi->addr.reuse = 0;
multi->size = bnd->size;
- multi->cksum = bnd->cksum;
+ multi->checksum = bnd->checksum;
bnd->addr.addr = NULL;
}
mod->mod_multi_entries = r->bnd_next;