summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2016-10-06 20:23:29 -0400
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-10-07 11:23:29 +1100
commit7b838e2403bf549daf2a8f27f5a67ed80a45f720 (patch)
tree512a895b75ed243ef37ca8e0cf63bd8048b10baf
parent4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a (diff)
downloadmongo-7b838e2403bf549daf2a8f27f5a67ed80a45f720.tar.gz
WT-2948 simplify error handling by making __wt_epoch return never fail (#3080)
If a system call to retrieve a timestamp fails it will now result in a panic. We couldn't find any case where that's a real possibility.
-rw-r--r--bench/wtperf/idle_table_cycle.c17
-rw-r--r--bench/wtperf/wtperf.c85
-rw-r--r--bench/wtperf/wtperf_throttle.c6
-rw-r--r--src/btree/bt_sync.c4
-rw-r--r--src/conn/conn_log.c4
-rw-r--r--src/conn/conn_stat.c2
-rw-r--r--src/conn/conn_sweep.c2
-rw-r--r--src/evict/evict_lru.c23
-rw-r--r--src/include/extern.h2
-rw-r--r--src/include/extern_posix.h2
-rw-r--r--src/include/extern_win.h2
-rw-r--r--src/include/misc.i6
-rw-r--r--src/log/log.c16
-rw-r--r--src/lsm/lsm_manager.c4
-rw-r--r--src/lsm/lsm_merge.c15
-rw-r--r--src/lsm/lsm_tree.c8
-rw-r--r--src/lsm/lsm_work_unit.c2
-rw-r--r--src/meta/meta_ckpt.c2
-rw-r--r--src/os_posix/os_mtx_cond.c2
-rw-r--r--src/os_posix/os_time.c14
-rw-r--r--src/os_win/os_time.c6
-rw-r--r--src/session/session_api.c4
-rw-r--r--src/session/session_compact.c9
-rw-r--r--src/session/session_dhandle.c11
-rw-r--r--src/support/err.c39
-rw-r--r--src/support/rand.c6
-rw-r--r--src/txn/txn_ckpt.c50
-rw-r--r--test/csuite/wt2323_join_visibility/main.c5
-rw-r--r--test/csuite/wt2695_checksum/main.c2
-rw-r--r--test/csuite/wt2719_reconfig/main.c2
-rw-r--r--test/csuite/wt2834_join_bloom_fix/main.c5
-rw-r--r--test/csuite/wt2853_perf/main.c2
-rw-r--r--test/format/t.c2
-rw-r--r--test/recovery/random-abort.c2
34 files changed, 145 insertions, 218 deletions
diff --git a/bench/wtperf/idle_table_cycle.c b/bench/wtperf/idle_table_cycle.c
index 60855e666b6..13fa55e86f5 100644
--- a/bench/wtperf/idle_table_cycle.c
+++ b/bench/wtperf/idle_table_cycle.c
@@ -34,21 +34,15 @@ check_timing(WTPERF *wtperf,
{
CONFIG_OPTS *opts;
uint64_t last_interval;
- int ret;
opts = wtperf->opts;
- if ((ret = __wt_epoch(NULL, stop)) != 0) {
- lprintf(wtperf, ret, 0,
- "Get time failed in cycle_idle_tables.");
- wtperf->error = true;
- return (ret);
- }
+ __wt_epoch(NULL, stop);
last_interval = (uint64_t)(WT_TIMEDIFF_SEC(*stop, start));
if (last_interval > opts->idle_table_cycle) {
- lprintf(wtperf, ret, 0,
+ lprintf(wtperf, ETIMEDOUT, 0,
"Cycling idle table failed because %s took %" PRIu64
" seconds which is longer than configured acceptable"
" maximum of %" PRIu32 ".",
@@ -92,12 +86,7 @@ cycle_idle_tables(void *arg)
__wt_sleep(1, 0);
/* Setup a start timer. */
- if ((ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0,
- "Get time failed in cycle_idle_tables.");
- wtperf->error = true;
- return (NULL);
- }
+ __wt_epoch(NULL, &start);
/* Create a table. */
if ((ret = session->create(
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 6a2c9acb126..a7618b19707 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -615,10 +615,8 @@ worker(void *arg)
measure_latency =
opts->sample_interval != 0 && trk != NULL &&
trk->ops != 0 && (trk->ops % opts->sample_rate == 0);
- if (measure_latency && (ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ if (measure_latency)
+ __wt_epoch(NULL, &start);
cursor->set_key(cursor, key_buf);
@@ -777,11 +775,7 @@ op_err: if (ret == WT_ROLLBACK && ops_per_txn != 0) {
/* Gather statistics */
if (!wtperf->in_warmup) {
if (measure_latency) {
- if ((ret = __wt_epoch(NULL, &stop)) != 0) {
- lprintf(wtperf, ret, 0,
- "Get time call failed");
- goto err;
- }
+ __wt_epoch(NULL, &stop);
++trk->latency_ops;
usecs = WT_TIMEDIFF_US(stop, start);
track_operation(trk, usecs);
@@ -1035,10 +1029,8 @@ populate_thread(void *arg)
measure_latency =
opts->sample_interval != 0 &&
trk->ops != 0 && (trk->ops % opts->sample_rate == 0);
- if (measure_latency && (ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ if (measure_latency)
+ __wt_epoch(NULL, &start);
cursor->set_key(cursor, key_buf);
if (opts->random_value)
randomize_value(thread, value_buf);
@@ -1064,10 +1056,7 @@ populate_thread(void *arg)
* of them.
*/
if (measure_latency) {
- if ((ret = __wt_epoch(NULL, &stop)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ __wt_epoch(NULL, &stop);
++trk->latency_ops;
usecs = WT_TIMEDIFF_US(stop, start);
track_operation(trk, usecs);
@@ -1157,10 +1146,9 @@ populate_async(void *arg)
measure_latency =
opts->sample_interval != 0 &&
trk->ops != 0 && (trk->ops % opts->sample_rate == 0);
- if (measure_latency && (ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ if (measure_latency)
+ __wt_epoch(NULL, &start);
+
/* Populate the databases. */
for (;;) {
op = get_next_incr(wtperf);
@@ -1187,6 +1175,7 @@ populate_async(void *arg)
goto err;
}
}
+
/*
* Gather statistics.
* We measure the latency of inserting a single key. If there
@@ -1198,10 +1187,7 @@ populate_async(void *arg)
if (conn->async_flush(conn) != 0)
goto err;
if (measure_latency) {
- if ((ret = __wt_epoch(NULL, &stop)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ __wt_epoch(NULL, &stop);
++trk->latency_ops;
usecs = WT_TIMEDIFF_US(stop, start);
track_operation(trk, usecs);
@@ -1235,7 +1221,7 @@ monitor(void *arg)
uint32_t update_avg, update_min, update_max;
uint32_t latency_max, level;
u_int i;
- int msg_err, ret;
+ int msg_err;
const char *str;
char buf[64], *path;
@@ -1289,10 +1275,7 @@ monitor(void *arg)
if (wtperf->in_warmup)
continue;
- if ((ret = __wt_epoch(NULL, &t)) != 0) {
- lprintf(wtperf, ret, 0, "Get time call failed");
- goto err;
- }
+ __wt_epoch(NULL, &t);
tm = localtime_r(&t.tv_sec, &_tm);
(void)strftime(buf, sizeof(buf), "%b %d %H:%M:%S", tm);
@@ -1421,11 +1404,8 @@ checkpoint_worker(void *arg)
if (wtperf->stop)
break;
- if ((ret = __wt_epoch(NULL, &s)) != 0) {
- lprintf(wtperf,
- ret, 0, "Get time failed in checkpoint.");
- goto err;
- }
+ __wt_epoch(NULL, &s);
+
wtperf->ckpt = true;
if ((ret = session->checkpoint(session, NULL)) != 0) {
lprintf(wtperf, ret, 0, "Checkpoint failed.");
@@ -1434,11 +1414,7 @@ checkpoint_worker(void *arg)
wtperf->ckpt = false;
++thread->ckpt.ops;
- if ((ret = __wt_epoch(NULL, &e)) != 0) {
- lprintf(wtperf,
- ret, 0, "Get time failed in checkpoint.");
- goto err;
- }
+ __wt_epoch(NULL, &e);
}
if (session != NULL &&
@@ -1497,10 +1473,7 @@ execute_populate(WTPERF *wtperf)
wtperf->popthreads, opts->populate_threads, pfunc)) != 0)
return (ret);
- if ((ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0, "Get time failed in populate.");
- return (ret);
- }
+ __wt_epoch(NULL, &start);
for (elapsed = 0, interval = 0, last_ops = 0;
wtperf->insert_key < opts->icount && !wtperf->error;) {
/*
@@ -1524,10 +1497,7 @@ execute_populate(WTPERF *wtperf)
opts->icount, opts->report_interval, wtperf->totalsec);
last_ops = wtperf->insert_ops;
}
- if ((ret = __wt_epoch(NULL, &stop)) != 0) {
- lprintf(wtperf, ret, 0, "Get time failed in populate.");
- return (ret);
- }
+ __wt_epoch(NULL, &stop);
/*
* Move popthreads aside to narrow possible race with the monitor
@@ -1576,10 +1546,7 @@ execute_populate(WTPERF *wtperf)
if (opts->compact) {
assert(opts->async_threads > 0);
lprintf(wtperf, 0, 1, "Compact after populate");
- if ((ret = __wt_epoch(NULL, &start)) != 0) {
- lprintf(wtperf, ret, 0, "Get time failed in populate.");
- return (ret);
- }
+ __wt_epoch(NULL, &start);
tables = opts->table_count;
for (i = 0; i < opts->table_count; i++) {
/*
@@ -1604,10 +1571,7 @@ execute_populate(WTPERF *wtperf)
lprintf(wtperf, ret, 0, "Populate async flush failed.");
return (ret);
}
- if ((ret = __wt_epoch(NULL, &stop)) != 0) {
- lprintf(wtperf, ret, 0, "Get time failed in populate.");
- return (ret);
- }
+ __wt_epoch(NULL, &stop);
lprintf(wtperf, 0, 1,
"Compact completed in %" PRIu64 " seconds",
(uint64_t)(WT_TIMEDIFF_SEC(stop, start)));
@@ -2666,10 +2630,7 @@ start_threads(WTPERF *wtperf,
* We don't want the threads executing in lock-step, seed each
* one differently.
*/
- if ((ret = __wt_random_init_seed(NULL, &thread->rnd)) != 0) {
- lprintf(wtperf, ret, 0, "Error initializing RNG");
- return (ret);
- }
+ __wt_random_init_seed(NULL, &thread->rnd);
/*
* Every thread gets a key/data buffer because we don't bother
@@ -2771,7 +2732,7 @@ drop_all_tables(WTPERF *wtperf)
"Error opening a session on %s", wtperf->home);
return (ret);
}
- testutil_check(__wt_epoch(NULL, &start));
+ __wt_epoch(NULL, &start);
for (i = 0; i < opts->table_count; i++) {
if ((ret =
session->drop(session, wtperf->uris[i], NULL)) != 0) {
@@ -2780,7 +2741,7 @@ drop_all_tables(WTPERF *wtperf)
goto err;
}
}
- testutil_check(__wt_epoch(NULL, &stop));
+ __wt_epoch(NULL, &stop);
msecs = WT_TIMEDIFF_MS(stop, start);
lprintf(wtperf, 0, 1,
"Executed %" PRIu32 " drop operations average time %" PRIu64 "ms",
diff --git a/bench/wtperf/wtperf_throttle.c b/bench/wtperf/wtperf_throttle.c
index 70b5084656f..d104a68175d 100644
--- a/bench/wtperf/wtperf_throttle.c
+++ b/bench/wtperf/wtperf_throttle.c
@@ -70,7 +70,7 @@ setup_throttle(WTPERF_THREAD *thread)
throttle_cfg->ops_count = throttle_cfg->ops_per_increment;
/* Set the first timestamp of when we incremented */
- testutil_check(__wt_epoch(NULL, &throttle_cfg->last_increment));
+ __wt_epoch(NULL, &throttle_cfg->last_increment);
}
/*
@@ -86,7 +86,7 @@ worker_throttle(WTPERF_THREAD *thread)
throttle_cfg = &thread->throttle_cfg;
- testutil_check(__wt_epoch(NULL, &now));
+ __wt_epoch(NULL, &now);
/*
* If we did enough operations in the current interval, sleep for
@@ -101,7 +101,7 @@ worker_throttle(WTPERF_THREAD *thread)
/*
* After sleeping, set the interval to the current time.
*/
- testutil_check(__wt_epoch(NULL, &throttle_cfg->last_increment));
+ __wt_epoch(NULL, &throttle_cfg->last_increment);
} else {
throttle_cfg->ops_count = (usecs_delta *
throttle_cfg->ops_per_increment) /
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c
index c9234bb5a45..7b583bd9c1e 100644
--- a/src/btree/bt_sync.c
+++ b/src/btree/bt_sync.c
@@ -37,7 +37,7 @@ __sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
internal_bytes = leaf_bytes = 0;
internal_pages = leaf_pages = 0;
if (WT_VERBOSE_ISSET(session, WT_VERB_CHECKPOINT))
- WT_RET(__wt_epoch(session, &start));
+ __wt_epoch(session, &start);
switch (syncop) {
case WT_SYNC_WRITE_LEAVES:
@@ -205,7 +205,7 @@ __sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
}
if (WT_VERBOSE_ISSET(session, WT_VERB_CHECKPOINT)) {
- WT_ERR(__wt_epoch(session, &end));
+ __wt_epoch(session, &end);
__wt_verbose(session, WT_VERB_CHECKPOINT,
"__sync_file WT_SYNC_%s wrote: %" PRIu64
" leaf pages (%" PRIu64 "B), %" PRIu64
diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c
index 2786526c2fa..34743034877 100644
--- a/src/conn/conn_log.c
+++ b/src/conn/conn_log.c
@@ -839,10 +839,10 @@ __log_server(void *arg)
/* Wait until the next event. */
- WT_ERR(__wt_epoch(session, &start));
+ __wt_epoch(session, &start);
__wt_cond_auto_wait_signal(session,
conn->log_cond, did_work, &signalled);
- WT_ERR(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
timediff = WT_TIMEDIFF_MS(now, start);
}
diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c
index 66979dfd023..d5a31c671c0 100644
--- a/src/conn/conn_stat.c
+++ b/src/conn/conn_stat.c
@@ -415,7 +415,7 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
conn = S2C(session);
/* Get the current local time of day. */
- WT_RET(__wt_epoch(session, &ts));
+ __wt_epoch(session, &ts);
tm = localtime_r(&ts.tv_sec, &_tm);
/* Create the logging path name for this time of day. */
diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c
index 03593f8951a..dba37fa2eb0 100644
--- a/src/conn/conn_sweep.c
+++ b/src/conn/conn_sweep.c
@@ -271,7 +271,7 @@ __sweep_server(void *arg)
/* Wait until the next event. */
__wt_cond_wait(session,
conn->sweep_cond, conn->sweep_interval * WT_MILLION);
- WT_ERR(__wt_seconds(session, &now));
+ __wt_seconds(session, &now);
WT_STAT_CONN_INCR(session, dh_sweeps);
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index 331467cbcce..62483a281d3 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -233,10 +233,10 @@ __wt_evict_thread_run(WT_SESSION_IMPL *session, WT_THREAD *thread)
#ifdef HAVE_DIAGNOSTIC
/*
- * Ensure the cache stuck timer is initialized when starting eviction
+ * Ensure the cache stuck timer is initialized when starting eviction.
*/
if (thread->id == 0)
- WT_ERR(__wt_epoch(session, &cache->stuck_ts));
+ __wt_epoch(session, &cache->stuck_ts);
#endif
while (F_ISSET(conn, WT_CONN_EVICTION_RUN) &&
@@ -350,10 +350,10 @@ __evict_server(WT_SESSION_IMPL *session, bool *did_work)
} else if (cache->pages_evicted != cache->pages_evict) {
cache->pages_evicted = cache->pages_evict;
#ifdef HAVE_DIAGNOSTIC
- WT_RET(__wt_epoch(session, &cache->stuck_ts));
+ __wt_epoch(session, &cache->stuck_ts);
} else {
/* After being stuck for 5 minutes, give up. */
- WT_RET(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
if (WT_TIMEDIFF_SEC(now, cache->stuck_ts) > 300) {
ret = ETIMEDOUT;
__wt_err(session, ret,
@@ -543,7 +543,7 @@ __evict_pass(WT_SESSION_IMPL *session)
/* Evict pages from the cache. */
for (loop = 0; cache->pass_intr == 0; loop++) {
- WT_RET(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
if (loop == 0)
prev = now;
@@ -1745,7 +1745,7 @@ __evict_page(WT_SESSION_IMPL *session, bool is_server)
cache->app_evicts++;
if (WT_STAT_ENABLED(session)) {
app_timer = true;
- WT_RET(__wt_epoch(session, &enter));
+ __wt_epoch(session, &enter);
}
}
@@ -1764,9 +1764,11 @@ __evict_page(WT_SESSION_IMPL *session, bool is_server)
(void)__wt_atomic_subv32(&btree->evict_busy, 1);
- if (ret == 0 && app_timer && __wt_epoch(session, &leave) == 0)
+ if (app_timer) {
+ __wt_epoch(session, &leave);
WT_STAT_CONN_INCRV(session,
application_evict_time, WT_TIMEDIFF_US(leave, enter));
+ }
return (ret);
}
@@ -1806,7 +1808,7 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full)
/* Track how long application threads spend doing eviction. */
if (WT_STAT_ENABLED(session) && !F_ISSET(session, WT_SESSION_INTERNAL))
- WT_RET(__wt_epoch(session, &enter));
+ __wt_epoch(session, &enter);
for (init_evict_count = cache->pages_evict;; ret = 0) {
/*
@@ -1872,10 +1874,11 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full)
}
err: if (WT_STAT_ENABLED(session) &&
- !F_ISSET(session, WT_SESSION_INTERNAL) &&
- __wt_epoch(session, &leave) == 0)
+ !F_ISSET(session, WT_SESSION_INTERNAL)) {
+ __wt_epoch(session, &leave);
WT_STAT_CONN_INCRV(session,
application_cache_time, WT_TIMEDIFF_US(leave, enter));
+ }
return (ret);
/* NOTREACHED */
diff --git a/src/include/extern.h b/src/include/extern.h
index 5444b2e9f14..e3cffa4ca3c 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -677,7 +677,7 @@ extern uint32_t __wt_log2_int(uint32_t n);
extern bool __wt_ispo2(uint32_t v);
extern uint32_t __wt_rduppo2(uint32_t n, uint32_t po2);
extern void __wt_random_init(WT_RAND_STATE volatile *rnd_state);
-extern int __wt_random_init_seed( WT_SESSION_IMPL *session, WT_RAND_STATE volatile *rnd_state) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern void __wt_random_init_seed( WT_SESSION_IMPL *session, WT_RAND_STATE volatile *rnd_state);
extern uint32_t __wt_random(WT_RAND_STATE volatile *rnd_state);
extern int __wt_buf_grow_worker(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_buf_fmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4))) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
diff --git a/src/include/extern_posix.h b/src/include/extern_posix.h
index d2f74d2ffe4..fd94ef0ddf2 100644
--- a/src/include/extern_posix.h
+++ b/src/include/extern_posix.h
@@ -27,5 +27,5 @@ extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds);
extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern void __wt_thread_id(char *buf, size_t buflen);
-extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern void __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp);
extern void __wt_yield(void);
diff --git a/src/include/extern_win.h b/src/include/extern_win.h
index 8c2b19056e0..f06ee881ece 100644
--- a/src/include/extern_win.h
+++ b/src/include/extern_win.h
@@ -25,7 +25,7 @@ extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds);
extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern void __wt_thread_id(char *buf, size_t buflen);
-extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern void __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp);
extern int __wt_to_utf16_string( WT_SESSION_IMPL *session, const char*utf8, WT_ITEM **outbuf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_to_utf8_string( WT_SESSION_IMPL *session, const wchar_t*wide, WT_ITEM **outbuf) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern DWORD __wt_getlasterror(void);
diff --git a/src/include/misc.i b/src/include/misc.i
index f267c7afc91..befd480e085 100644
--- a/src/include/misc.i
+++ b/src/include/misc.i
@@ -33,16 +33,14 @@ __wt_strdup(WT_SESSION_IMPL *session, const char *str, void *retp)
* __wt_seconds --
* Return the seconds since the Epoch.
*/
-static inline int
+static inline void
__wt_seconds(WT_SESSION_IMPL *session, time_t *timep)
{
struct timespec t;
- WT_RET(__wt_epoch(session, &t));
+ __wt_epoch(session, &t);
*timep = t.tv_sec;
-
- return (0);
}
/*
diff --git a/src/log/log.c b/src/log/log.c
index b0c789f0f9e..00e4ea5f441 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -128,9 +128,9 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
"log_force_sync: sync directory %s to LSN %" PRIu32
"/%" PRIu32,
log->log_dir_fh->name, min_lsn->l.file, min_lsn->l.offset);
- WT_ERR(__wt_epoch(session, &fsync_start));
+ __wt_epoch(session, &fsync_start);
WT_ERR(__wt_fsync(session, log->log_dir_fh, true));
- WT_ERR(__wt_epoch(session, &fsync_stop));
+ __wt_epoch(session, &fsync_stop);
fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start);
log->sync_dir_lsn = *min_lsn;
WT_STAT_CONN_INCR(session, log_sync_dir);
@@ -152,9 +152,9 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn)
__wt_verbose(session, WT_VERB_LOG,
"log_force_sync: sync %s to LSN %" PRIu32 "/%" PRIu32,
log_fh->name, min_lsn->l.file, min_lsn->l.offset);
- WT_ERR(__wt_epoch(session, &fsync_start));
+ __wt_epoch(session, &fsync_start);
WT_ERR(__wt_fsync(session, log_fh, true));
- WT_ERR(__wt_epoch(session, &fsync_stop));
+ __wt_epoch(session, &fsync_stop);
fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start);
log->sync_lsn = *min_lsn;
WT_STAT_CONN_INCR(session, log_sync);
@@ -1478,9 +1478,9 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep)
"/%" PRIu32,
log->log_dir_fh->name,
sync_lsn.l.file, sync_lsn.l.offset);
- WT_ERR(__wt_epoch(session, &fsync_start));
+ __wt_epoch(session, &fsync_start);
WT_ERR(__wt_fsync(session, log->log_dir_fh, true));
- WT_ERR(__wt_epoch(session, &fsync_stop));
+ __wt_epoch(session, &fsync_stop);
fsync_duration_usecs =
WT_TIMEDIFF_US(fsync_stop, fsync_start);
log->sync_dir_lsn = sync_lsn;
@@ -1500,9 +1500,9 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep)
log->log_fh->name,
sync_lsn.l.file, sync_lsn.l.offset);
WT_STAT_CONN_INCR(session, log_sync);
- WT_ERR(__wt_epoch(session, &fsync_start));
+ __wt_epoch(session, &fsync_start);
WT_ERR(__wt_fsync(session, log->log_fh, true));
- WT_ERR(__wt_epoch(session, &fsync_stop));
+ __wt_epoch(session, &fsync_stop);
fsync_duration_usecs =
WT_TIMEDIFF_US(fsync_stop, fsync_start);
WT_STAT_CONN_INCRV(session,
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index 5a5140b9c3a..0a5f4fdd8b5 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -392,7 +392,7 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session)
TAILQ_FOREACH(lsm_tree, &S2C(session)->lsmqh, q) {
if (!lsm_tree->active)
continue;
- WT_ERR(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
pushms = lsm_tree->work_push_ts.tv_sec == 0 ? 0 :
WT_TIMEDIFF_MS(now, lsm_tree->work_push_ts);
fillms = 3 * lsm_tree->chunk_fill_ms;
@@ -651,7 +651,7 @@ __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session,
return (0);
}
- WT_RET(__wt_epoch(session, &lsm_tree->work_push_ts));
+ __wt_epoch(session, &lsm_tree->work_push_ts);
WT_RET(__wt_calloc_one(session, &entry));
entry->type = type;
entry->flags = flags;
diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c
index 4bbfcfd4411..493855d489a 100644
--- a/src/lsm/lsm_merge.c
+++ b/src/lsm/lsm_merge.c
@@ -54,7 +54,7 @@ __lsm_merge_aggressive_clear(WT_LSM_TREE *lsm_tree)
* __lsm_merge_aggressive_update --
* Update the merge aggressiveness for an LSM tree.
*/
-static int
+static void
__lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
{
struct timespec now;
@@ -72,7 +72,7 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
if (!lsm_tree->modified ||
F_ISSET(lsm_tree, WT_LSM_TREE_COMPACTING)) {
lsm_tree->merge_aggressiveness = 10;
- return (0);
+ return;
}
/*
@@ -81,7 +81,7 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
*/
if (lsm_tree->chunks_flushed <= lsm_tree->merge_min) {
__lsm_merge_aggressive_clear(lsm_tree);
- return (0);
+ return;
}
/*
@@ -91,10 +91,10 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
*/
if (!F_ISSET(lsm_tree, WT_LSM_TREE_AGGRESSIVE_TIMER)) {
F_SET(lsm_tree, WT_LSM_TREE_AGGRESSIVE_TIMER);
- return (__wt_epoch(session, &lsm_tree->merge_aggressive_ts));
+ __wt_epoch(session, &lsm_tree->merge_aggressive_ts);
}
- WT_RET(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
msec_since_last_merge =
WT_TIMEDIFF_MS(now, lsm_tree->merge_aggressive_ts);
@@ -113,7 +113,7 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
* generates a variable load.
*/
if (msec_since_last_merge < msec_to_create_merge)
- return (0);
+ return;
/*
* Bump how aggressively we look for merges based on how long since
@@ -134,7 +134,6 @@ __lsm_merge_aggressive_update(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
msec_since_last_merge, lsm_tree->chunk_fill_ms);
lsm_tree->merge_aggressiveness = new_aggressive;
}
- return (0);
}
/*
@@ -326,7 +325,7 @@ retry_find:
goto retry_find;
}
/* Consider getting aggressive if no merge was found */
- WT_RET(__lsm_merge_aggressive_update(session, lsm_tree));
+ __lsm_merge_aggressive_update(session, lsm_tree);
return (WT_NOTFOUND);
}
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index db9fd581110..0054dcd1583 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -265,7 +265,7 @@ __wt_lsm_tree_setup_chunk(
WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk)
{
WT_ASSERT(session, F_ISSET(session, WT_SESSION_LOCKED_SCHEMA));
- WT_RET(__wt_epoch(session, &chunk->create_ts));
+ __wt_epoch(session, &chunk->create_ts);
WT_RET(__wt_lsm_tree_chunk_name(
session, lsm_tree, chunk->id, &chunk->uri));
@@ -496,7 +496,7 @@ __lsm_tree_open(WT_SESSION_IMPL *session,
lsm_tree->queue_ref = 0;
/* Set a flush timestamp as a baseline. */
- WT_ERR(__wt_epoch(session, &lsm_tree->last_flush_ts));
+ __wt_epoch(session, &lsm_tree->last_flush_ts);
/* Now the tree is setup, make it visible to others. */
TAILQ_INSERT_HEAD(&S2C(session)->lsmqh, lsm_tree, q);
@@ -1139,7 +1139,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
return (0);
}
- WT_ERR(__wt_seconds(session, &begin));
+ __wt_seconds(session, &begin);
/*
* Compacting has two distinct phases.
@@ -1267,7 +1267,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
break;
}
__wt_sleep(1, 0);
- WT_ERR(__wt_seconds(session, &end));
+ __wt_seconds(session, &end);
if (session->compact->max_time > 0 &&
session->compact->max_time < (uint64_t)(end - begin)) {
WT_ERR(ETIMEDOUT);
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c
index 72bcf56b3c4..917104031fc 100644
--- a/src/lsm/lsm_work_unit.c
+++ b/src/lsm/lsm_work_unit.c
@@ -358,7 +358,7 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
WT_ERR(__wt_lsm_tree_set_chunk_size(session, chunk));
/* Update the flush timestamp to help track ongoing progress. */
- WT_ERR(__wt_epoch(session, &lsm_tree->last_flush_ts));
+ __wt_epoch(session, &lsm_tree->last_flush_ts);
++lsm_tree->chunks_flushed;
/* Lock the tree, mark the chunk as on disk and update the metadata. */
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index 2b7719c3241..b985104c2eb 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -424,7 +424,7 @@ __wt_meta_ckptlist_set(WT_SESSION_IMPL *session,
* guaranteed, a time_t has to be an arithmetic type,
* but not an integral type.
*/
- WT_ERR(__wt_seconds(session, &secs));
+ __wt_seconds(session, &secs);
ckpt->sec = (uintmax_t)secs;
}
if (strcmp(ckpt->name, WT_CHECKPOINT) == 0)
diff --git a/src/os_posix/os_mtx_cond.c b/src/os_posix/os_mtx_cond.c
index b25bb8c25d1..842bb6eeec9 100644
--- a/src/os_posix/os_mtx_cond.c
+++ b/src/os_posix/os_mtx_cond.c
@@ -63,7 +63,7 @@ __wt_cond_wait_signal(
locked = true;
if (usecs > 0) {
- WT_ERR(__wt_epoch(session, &ts));
+ __wt_epoch(session, &ts);
ts.tv_sec += (time_t)
(((uint64_t)ts.tv_nsec + WT_THOUSAND * usecs) / WT_BILLION);
ts.tv_nsec = (long)
diff --git a/src/os_posix/os_time.c b/src/os_posix/os_time.c
index b1b22a8e684..c7ae881af97 100644
--- a/src/os_posix/os_time.c
+++ b/src/os_posix/os_time.c
@@ -12,26 +12,26 @@
* __wt_epoch --
* Return the time since the Epoch.
*/
-int
+void
__wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
{
WT_DECL_RET;
#if defined(HAVE_CLOCK_GETTIME)
- WT_SYSCALL(clock_gettime(CLOCK_REALTIME, tsp), ret);
+ WT_SYSCALL_RETRY(clock_gettime(CLOCK_REALTIME, tsp), ret);
if (ret == 0)
- return (0);
- WT_RET_MSG(session, ret, "clock_gettime");
+ return;
+ WT_PANIC_MSG(session, ret, "clock_gettime");
#elif defined(HAVE_GETTIMEOFDAY)
struct timeval v;
- WT_SYSCALL(gettimeofday(&v, NULL), ret);
+ WT_SYSCALL_RETRY(gettimeofday(&v, NULL), ret);
if (ret == 0) {
tsp->tv_sec = v.tv_sec;
tsp->tv_nsec = v.tv_usec * WT_THOUSAND;
- return (0);
+ return;
}
- WT_RET_MSG(session, ret, "gettimeofday");
+ WT_PANIC_MSG(session, ret, "gettimeofday");
#else
NO TIME-OF-DAY IMPLEMENTATION: see src/os_posix/os_time.c
#endif
diff --git a/src/os_win/os_time.c b/src/os_win/os_time.c
index e784b5d8a36..6aa5b3719f6 100644
--- a/src/os_win/os_time.c
+++ b/src/os_win/os_time.c
@@ -12,11 +12,11 @@
* __wt_epoch --
* Return the time since the Epoch.
*/
-int
+void
__wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
{
- uint64_t ns100;
FILETIME time;
+ uint64_t ns100;
WT_UNUSED(session);
@@ -26,8 +26,6 @@ __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
- 116444736000000000LL;
tsp->tv_sec = ns100 / 10000000;
tsp->tv_nsec = (long)((ns100 % 10000000) * 100);
-
- return (0);
}
/*
diff --git a/src/session/session_api.c b/src/session/session_api.c
index 426354b4994..d3432c19ef3 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -1495,14 +1495,14 @@ __session_transaction_sync(WT_SESSION *wt_session, const char *config)
if (timeout_ms == 0)
WT_ERR(ETIMEDOUT);
- WT_ERR(__wt_epoch(session, &start));
+ __wt_epoch(session, &start);
/*
* Keep checking the LSNs until we find it is stable or we reach
* our timeout.
*/
while (__wt_log_cmp(&session->bg_sync_lsn, &log->sync_lsn) > 0) {
__wt_cond_signal(session, conn->log_file_cond);
- WT_ERR(__wt_epoch(session, &now));
+ __wt_epoch(session, &now);
waited_ms = WT_TIMEDIFF_MS(now, start);
if (forever || waited_ms < timeout_ms)
/*
diff --git a/src/session/session_compact.c b/src/session/session_compact.c
index f03d5d34bac..66635007723 100644
--- a/src/session/session_compact.c
+++ b/src/session/session_compact.c
@@ -179,17 +179,16 @@ __compact_handle_append(WT_SESSION_IMPL *session, const char *cfg[])
* Check if the timeout has been exceeded.
*/
static int
-__session_compact_check_timeout(
- WT_SESSION_IMPL *session, struct timespec begin)
+__session_compact_check_timeout(WT_SESSION_IMPL *session, struct timespec begin)
{
struct timespec end;
if (session->compact->max_time == 0)
return (0);
- WT_RET(__wt_epoch(session, &end));
+ __wt_epoch(session, &end);
if (session->compact->max_time < WT_TIMEDIFF_SEC(end, begin))
- WT_RET(ETIMEDOUT);
+ return (ETIMEDOUT);
return (0);
}
@@ -219,7 +218,7 @@ __compact_file(WT_SESSION_IMPL *session, const char *cfg[])
session, t, "target=(\"%s\"),force=1", dhandle->name));
checkpoint_cfg[1] = t->data;
- WT_ERR(__wt_epoch(session, &start_time));
+ __wt_epoch(session, &start_time);
/*
* We compact 10% of the file on each pass (but the overall size of the
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index e76407567bc..725854c6001 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -8,8 +8,6 @@
#include "wt_internal.h"
-static int __session_dhandle_sweep(WT_SESSION_IMPL *);
-
/*
* __session_add_dhandle --
* Add a handle to the session's cache.
@@ -371,7 +369,7 @@ __wt_session_close_cache(WT_SESSION_IMPL *session)
* __session_dhandle_sweep --
* Discard any session dhandles that are not open.
*/
-static int
+static void
__session_dhandle_sweep(WT_SESSION_IMPL *session)
{
WT_CONNECTION_IMPL *conn;
@@ -385,9 +383,9 @@ __session_dhandle_sweep(WT_SESSION_IMPL *session)
* Periodically sweep for dead handles; if we've swept recently, don't
* do it again.
*/
- WT_RET(__wt_seconds(session, &now));
+ __wt_seconds(session, &now);
if (difftime(now, session->last_sweep) < conn->sweep_interval)
- return (0);
+ return;
session->last_sweep = now;
WT_STAT_CONN_INCR(session, dh_session_sweeps);
@@ -408,7 +406,6 @@ __session_dhandle_sweep(WT_SESSION_IMPL *session)
}
dhandle_cache = dhandle_cache_next;
}
- return (0);
}
/*
@@ -446,7 +443,7 @@ __session_get_dhandle(
}
/* Sweep the handle list to remove any dead handles. */
- WT_RET(__session_dhandle_sweep(session));
+ __session_dhandle_sweep(session);
/*
* We didn't find a match in the session cache, search the shared
diff --git a/src/support/err.c b/src/support/err.c
index 8bfac250b3a..3ecbab1cbe9 100644
--- a/src/support/err.c
+++ b/src/support/err.c
@@ -162,7 +162,6 @@ __wt_eventv(WT_SESSION_IMPL *session, bool msg_event, int error,
WT_SESSION *wt_session;
struct timespec ts;
size_t len, remain, wlen;
- int prefix_cnt;
const char *err, *prefix;
char *end, *p, tid[128];
@@ -211,44 +210,32 @@ __wt_eventv(WT_SESSION_IMPL *session, bool msg_event, int error,
* name, and the session's name. Write them as a comma-separate list,
* followed by a colon.
*/
- prefix_cnt = 0;
- if (__wt_epoch(session, &ts) == 0) {
- __wt_thread_id(tid, sizeof(tid));
- remain = WT_PTRDIFF(end, p);
- wlen = (size_t)snprintf(p, remain,
- "[%" PRIuMAX ":%" PRIuMAX "][%s]",
- (uintmax_t)ts.tv_sec,
- (uintmax_t)ts.tv_nsec / WT_THOUSAND, tid);
- p = wlen >= remain ? end : p + wlen;
- prefix_cnt = 1;
- }
+ __wt_epoch(session, &ts);
+ __wt_thread_id(tid, sizeof(tid));
+ remain = WT_PTRDIFF(end, p);
+ wlen = (size_t)snprintf(p, remain, "[%" PRIuMAX ":%" PRIuMAX "][%s]",
+ (uintmax_t)ts.tv_sec, (uintmax_t)ts.tv_nsec / WT_THOUSAND, tid);
+ p = wlen >= remain ? end : p + wlen;
+
if ((prefix = S2C(session)->error_prefix) != NULL) {
remain = WT_PTRDIFF(end, p);
- wlen = (size_t)snprintf(p, remain,
- "%s%s", prefix_cnt == 0 ? "" : ", ", prefix);
+ wlen = (size_t)snprintf(p, remain, ", %s", prefix);
p = wlen >= remain ? end : p + wlen;
- prefix_cnt = 1;
}
prefix = session->dhandle == NULL ? NULL : session->dhandle->name;
if (prefix != NULL) {
remain = WT_PTRDIFF(end, p);
- wlen = (size_t)snprintf(p, remain,
- "%s%s", prefix_cnt == 0 ? "" : ", ", prefix);
+ wlen = (size_t)snprintf(p, remain, ", %s", prefix);
p = wlen >= remain ? end : p + wlen;
- prefix_cnt = 1;
}
if ((prefix = session->name) != NULL) {
remain = WT_PTRDIFF(end, p);
- wlen = (size_t)snprintf(p, remain,
- "%s%s", prefix_cnt == 0 ? "" : ", ", prefix);
- p = wlen >= remain ? end : p + wlen;
- prefix_cnt = 1;
- }
- if (prefix_cnt != 0) {
- remain = WT_PTRDIFF(end, p);
- wlen = (size_t)snprintf(p, remain, ": ");
+ wlen = (size_t)snprintf(p, remain, ", %s", prefix);
p = wlen >= remain ? end : p + wlen;
}
+ remain = WT_PTRDIFF(end, p);
+ wlen = (size_t)snprintf(p, remain, ": ");
+ p = wlen >= remain ? end : p + wlen;
if (file_name != NULL) {
remain = WT_PTRDIFF(end, p);
diff --git a/src/support/rand.c b/src/support/rand.c
index d2e4cd27aab..025b18e4ed3 100644
--- a/src/support/rand.c
+++ b/src/support/rand.c
@@ -66,20 +66,18 @@ __wt_random_init(WT_RAND_STATE volatile * rnd_state)
* threads and we want each thread to initialize its own random state based
* on a different random seed.
*/
-int
+void
__wt_random_init_seed(
WT_SESSION_IMPL *session, WT_RAND_STATE volatile * rnd_state)
{
struct timespec ts;
WT_RAND_STATE rnd;
- WT_RET(__wt_epoch(session, &ts));
+ __wt_epoch(session, &ts);
M_W(rnd) = (uint32_t)(ts.tv_nsec + 521288629);
M_Z(rnd) = (uint32_t)(ts.tv_nsec + 362436069);
*rnd_state = rnd;
-
- return (0);
}
/*
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 9999b3f6f0a..0557e6ce60c 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -314,7 +314,7 @@ __checkpoint_update_generation(WT_SESSION_IMPL *session)
* __checkpoint_reduce_dirty_cache --
* Release clean trees from the list cached for checkpoints.
*/
-static int
+static void
__checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
{
WT_CACHE *cache;
@@ -332,9 +332,9 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
/* Give up if scrubbing is disabled. */
if (cache->eviction_checkpoint_target == 0 ||
cache->eviction_checkpoint_target >= cache->eviction_dirty_trigger)
- return (0);
+ return;
- WT_RET(__wt_epoch(session, &start));
+ __wt_epoch(session, &start);
last = start;
bytes_written_last = 0;
bytes_written_start = cache->bytes_written;
@@ -345,7 +345,7 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
* cache via reconfigure. This avoids potential divide by zero.
*/
if (cache_size < 10 * WT_MEGABYTE)
- return (0);
+ return;
stepdown_us = 10000;
work_us = 0;
progress = false;
@@ -371,7 +371,7 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
break;
__wt_sleep(0, stepdown_us / 10);
- WT_RET(__wt_epoch(session, &stop));
+ __wt_epoch(session, &stop);
current_us = WT_TIMEDIFF_US(stop, last);
total_ms = WT_TIMEDIFF_MS(stop, start);
bytes_written_total =
@@ -427,14 +427,12 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session)
WT_MAX(cache->eviction_dirty_target, current_dirty - delta);
WT_STAT_CONN_SET(session, txn_checkpoint_scrub_target,
cache->eviction_scrub_limit);
- WT_RET(__wt_epoch(session, &last));
+ __wt_epoch(session, &last);
}
- WT_RET(__wt_epoch(session, &stop));
+ __wt_epoch(session, &stop);
total_ms = WT_TIMEDIFF_MS(stop, start);
WT_STAT_CONN_SET(session, txn_checkpoint_scrub_time, total_ms);
-
- return (0);
}
/*
@@ -497,7 +495,7 @@ __checkpoint_stats(
* __checkpoint_verbose_track --
* Output a verbose message with timing information
*/
-static int
+static void
__checkpoint_verbose_track(WT_SESSION_IMPL *session,
const char *msg, struct timespec *start)
{
@@ -506,9 +504,9 @@ __checkpoint_verbose_track(WT_SESSION_IMPL *session,
uint64_t msec;
if (!WT_VERBOSE_ISSET(session, WT_VERB_CHECKPOINT))
- return (0);
+ return;
- WT_RET(__wt_epoch(session, &stop));
+ __wt_epoch(session, &stop);
/*
* Get time diff in microseconds.
@@ -526,7 +524,6 @@ __checkpoint_verbose_track(WT_SESSION_IMPL *session,
WT_UNUSED(msg);
WT_UNUSED(start);
#endif
- return (0);
}
/*
@@ -576,7 +573,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
conn->cache->evict_max_page_size = 0;
/* Initialize the verbose tracking timer */
- WT_ERR(__wt_epoch(session, &verb_timer));
+ __wt_epoch(session, &verb_timer);
/*
* Update the global oldest ID so we do all possible cleanup.
@@ -594,18 +591,18 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
* Try to reduce the amount of dirty data in cache so there is less
* work do during the critical section of the checkpoint.
*/
- WT_ERR(__checkpoint_reduce_dirty_cache(session));
+ __checkpoint_reduce_dirty_cache(session);
/* Tell logging that we are about to start a database checkpoint. */
if (full && logging)
WT_ERR(__wt_txn_checkpoint_log(
session, full, WT_TXN_LOG_CKPT_PREPARE, NULL));
- WT_ERR(__checkpoint_verbose_track(session,
- "starting transaction", &verb_timer));
+ __checkpoint_verbose_track(session,
+ "starting transaction", &verb_timer);
if (full)
- WT_ERR(__wt_epoch(session, &start));
+ __wt_epoch(session, &start);
/*
* Start the checkpoint for real.
@@ -747,23 +744,22 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
WT_ERR(__checkpoint_apply(session, cfg, __checkpoint_presync));
__wt_evict_server_wake(session);
- WT_ERR(__checkpoint_verbose_track(session,
- "committing transaction", &verb_timer));
+ __checkpoint_verbose_track(session,
+ "committing transaction", &verb_timer);
/*
* Checkpoints have to hit disk (it would be reasonable to configure for
* lazy checkpoints, but we don't support them yet).
*/
- WT_ERR(__wt_epoch(session, &fsync_start));
+ __wt_epoch(session, &fsync_start);
WT_ERR(__checkpoint_apply(session, cfg, __wt_checkpoint_sync));
- WT_ERR(__wt_epoch(session, &fsync_stop));
+ __wt_epoch(session, &fsync_stop);
fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start);
WT_STAT_CONN_INCR(session, txn_checkpoint_fsync_post);
WT_STAT_CONN_SET(session,
txn_checkpoint_fsync_post_duration, fsync_duration_usecs);
- WT_ERR(__checkpoint_verbose_track(session,
- "sync completed", &verb_timer));
+ __checkpoint_verbose_track(session, "sync completed", &verb_timer);
/*
* Commit the transaction now that we are sure that all files in the
@@ -801,8 +797,8 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
ret = __wt_checkpoint_sync(session, NULL));
WT_ERR(ret);
- WT_ERR(__checkpoint_verbose_track(session,
- "metadata sync completed", &verb_timer));
+ __checkpoint_verbose_track(session,
+ "metadata sync completed", &verb_timer);
} else
WT_WITH_DHANDLE(session,
WT_SESSION_META_DHANDLE(session),
@@ -816,7 +812,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
txn_global->checkpoint_pinned = WT_TXN_NONE;
if (full) {
- WT_ERR(__wt_epoch(session, &stop));
+ __wt_epoch(session, &stop);
__checkpoint_stats(session, &start, &stop);
}
diff --git a/test/csuite/wt2323_join_visibility/main.c b/test/csuite/wt2323_join_visibility/main.c
index 75aef530368..5987b77fd7d 100644
--- a/test/csuite/wt2323_join_visibility/main.c
+++ b/test/csuite/wt2323_join_visibility/main.c
@@ -227,7 +227,8 @@ test_join(TEST_OPTS *opts, SHARED_OPTS *sharedopts, bool bloom,
testutil_check(session->close(session, NULL));
}
-static void *thread_insert(void *arg)
+static void *
+thread_insert(void *arg)
{
SHARED_OPTS *sharedopts;
TEST_OPTS *opts;
@@ -241,7 +242,7 @@ static void *thread_insert(void *arg)
threadargs = (THREAD_ARGS *)arg;
opts = threadargs->testopts;
sharedopts = threadargs->sharedopts;
- testutil_check(__wt_random_init_seed(NULL, &rnd));
+ __wt_random_init_seed(NULL, &rnd);
testutil_check(opts->conn->open_session(
opts->conn, NULL, NULL, &session));
diff --git a/test/csuite/wt2695_checksum/main.c b/test/csuite/wt2695_checksum/main.c
index afb9d0788bd..50f118bf828 100644
--- a/test/csuite/wt2695_checksum/main.c
+++ b/test/csuite/wt2695_checksum/main.c
@@ -61,7 +61,7 @@ main(int argc, char *argv[])
wiredtiger_open(opts->home, NULL, "create", &opts->conn));
/* Initialize the RNG. */
- testutil_check(__wt_random_init_seed(NULL, &rnd));
+ __wt_random_init_seed(NULL, &rnd);
/* Allocate aligned memory for the data. */
data = dcalloc(DATASIZE, sizeof(uint8_t));
diff --git a/test/csuite/wt2719_reconfig/main.c b/test/csuite/wt2719_reconfig/main.c
index b67dae6d647..64a47ea49a6 100644
--- a/test/csuite/wt2719_reconfig/main.c
+++ b/test/csuite/wt2719_reconfig/main.c
@@ -256,7 +256,7 @@ main(int argc, char *argv[])
session, opts->uri, "type=lsm,key_format=S,value_format=S"));
/* Initialize the RNG. */
- testutil_check(__wt_random_init_seed(NULL, &rnd));
+ __wt_random_init_seed(NULL, &rnd);
/* Allocate memory for the config. */
len = WT_ELEMENTS(list) * 64;
diff --git a/test/csuite/wt2834_join_bloom_fix/main.c b/test/csuite/wt2834_join_bloom_fix/main.c
index 0b21ba0607b..1d6abcfb179 100644
--- a/test/csuite/wt2834_join_bloom_fix/main.c
+++ b/test/csuite/wt2834_join_bloom_fix/main.c
@@ -161,7 +161,8 @@ main(int argc, char *argv[])
return (0);
}
-void populate(TEST_OPTS *opts)
+void
+populate(TEST_OPTS *opts)
{
WT_CURSOR *maincur;
WT_SESSION *session;
@@ -169,7 +170,7 @@ void populate(TEST_OPTS *opts)
int balance, i, flag, post;
WT_RAND_STATE rnd;
- testutil_check(__wt_random_init_seed(NULL, &rnd));
+ __wt_random_init_seed(NULL, &rnd);
testutil_check(opts->conn->open_session(
opts->conn, NULL, NULL, &session));
diff --git a/test/csuite/wt2853_perf/main.c b/test/csuite/wt2853_perf/main.c
index 67ba4a20ada..27591fdf214 100644
--- a/test/csuite/wt2853_perf/main.c
+++ b/test/csuite/wt2853_perf/main.c
@@ -201,7 +201,7 @@ thread_insert(void *arg)
threadargs = (THREAD_ARGS *)arg;
opts = threadargs->testopts;
- testutil_check(__wt_random_init_seed(NULL, &rnd));
+ __wt_random_init_seed(NULL, &rnd);
(void)time(&prevtime);
testutil_check(opts->conn->open_session(
diff --git a/test/format/t.c b/test/format/t.c
index 12258af8e51..41bdea11e73 100644
--- a/test/format/t.c
+++ b/test/format/t.c
@@ -115,7 +115,7 @@ main(int argc, char *argv[])
argv += __wt_optind;
/* Initialize the global RNG. */
- testutil_check(__wt_random_init_seed(NULL, &g.rnd));
+ __wt_random_init_seed(NULL, &g.rnd);
/* Set up paths. */
path_setup(home);
diff --git a/test/recovery/random-abort.c b/test/recovery/random-abort.c
index 16065cec29e..22a163bedff 100644
--- a/test/recovery/random-abort.c
+++ b/test/recovery/random-abort.c
@@ -245,7 +245,7 @@ main(int argc, char *argv[])
if (!verify_only) {
testutil_make_work_dir(home);
- testutil_assert(__wt_random_init_seed(NULL, &rnd) == 0);
+ __wt_random_init_seed(NULL, &rnd);
if (rand_time) {
timeout = __wt_random(&rnd) % MAX_TIME;
if (timeout < MIN_TIME)