diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-09-14 14:42:58 +1000 |
---|---|---|
committer | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-12-22 10:57:41 +1100 |
commit | 9969d473ffcf43d1014c3db13f5c639e83ee7df1 (patch) | |
tree | d84d4e73ce1fe8efbcb7293d9bb849154e18f731 | |
parent | 2cfb3e0bdc46deb7ad4546cce529b6084cc9d922 (diff) | |
download | mongo-9969d473ffcf43d1014c3db13f5c639e83ee7df1.tar.gz |
SERVER-25012 Use non blocking call for opening bulk cursor to WT
(cherry picked from commit d8ac57088d8eae13cf4bed7d9232bddea27e8052)
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index e5c478932ac..63993365b95 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -494,9 +494,13 @@ protected: // Not using cursor cache since we need to set "bulk". WT_CURSOR* cursor; - // We use our own session to ensure we aren't in a transaction. + // Use a different session to ensure we don't hijack an existing transaction. + // Configure the bulk cursor open to fail quickly if it would wait on a checkpoint + // completing - since checkpoints can take a long time, and waiting can result in + // an unexpected pause in building an index. WT_SESSION* session = _session->getSession(); - int err = session->open_cursor(session, idx->uri().c_str(), NULL, "bulk", &cursor); + int err = session->open_cursor( + session, idx->uri().c_str(), NULL, "bulk,checkpoint_wait=false", &cursor); if (!err) return cursor; |