diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-10-06 20:23:29 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-10-07 11:23:29 +1100 |
commit | 7b838e2403bf549daf2a8f27f5a67ed80a45f720 (patch) | |
tree | 512a895b75ed243ef37ca8e0cf63bd8048b10baf /src/lsm | |
parent | 4aa57e5ed1b0ada49c47be325b83f21c2e5fb56a (diff) | |
download | mongo-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.
Diffstat (limited to 'src/lsm')
-rw-r--r-- | src/lsm/lsm_manager.c | 4 | ||||
-rw-r--r-- | src/lsm/lsm_merge.c | 15 | ||||
-rw-r--r-- | src/lsm/lsm_tree.c | 8 | ||||
-rw-r--r-- | src/lsm/lsm_work_unit.c | 2 |
4 files changed, 14 insertions, 15 deletions
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. */ |