diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-02-01 09:17:41 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-02-01 09:17:41 -0500 |
commit | 612e1fd97fb1e8693e314e41810af15d6c63113e (patch) | |
tree | 38d47a351b7da70504bfb122e2f34d1a0ab1b694 /ext | |
parent | ba66d442df0699065b7ff4763dcd8dfb4968a0eb (diff) | |
download | mongo-612e1fd97fb1e8693e314e41810af15d6c63113e.tar.gz |
Don't bother with a final pass to clean out the cache if we didn't migrate
any changes from the cache to the primary, that pass would be holding locks
and it's not likely to help things much.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/datasources/helium/helium.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/datasources/helium/helium.c b/ext/datasources/helium/helium.c index bfbe6ed7d11..34f65e0bf3d 100644 --- a/ext/datasources/helium/helium.c +++ b/ext/datasources/helium/helium.c @@ -2531,7 +2531,7 @@ cache_cleaner(WT_EXTENSION_API *wtext, HE_ITEM *r; WT_SOURCE *ws; uint64_t txnid; - int locked, recovery, ret = 0; + int locked, pushed, recovery, ret = 0; /* * Called in two ways: in normal processing mode where we're supplied a @@ -2550,7 +2550,7 @@ cache_cleaner(WT_EXTENSION_API *wtext, cursor = (CURSOR *)wtcursor; ws = cursor->ws; r = &cursor->record; - locked = 0; + locked = pushed = 0; /* * For every cache key where all updates are globally visible: @@ -2577,6 +2577,8 @@ cache_cleaner(WT_EXTENSION_API *wtext, cache_value_last_not_aborted(wtcursor, &cp); if (cp == NULL) continue; + + pushed = 1; if (cp->remove) { if ((ret = he_delete(ws->he, r)) == 0) continue; @@ -2617,6 +2619,14 @@ cache_cleaner(WT_EXTENSION_API *wtext, ERET(wtext, NULL, ret, "he_next: %s", he_strerror(ret)); /* + * If we didn't move any keys from the cache to the primary, quit. It's + * possible we could still remove values from the cache, but not likely, + * and another pass would probably be wasted effort (especially locked). + */ + if (!pushed) + return (0); + + /* * Push the store to stable storage for correctness. (It doesn't matter * what Helium handle we commit, so we just commit one of them.) */ |