diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-09-14 14:42:58 +1000 |
---|---|---|
committer | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-09-20 10:04:52 +1000 |
commit | d8ac57088d8eae13cf4bed7d9232bddea27e8052 (patch) | |
tree | 77551278c53c3fe0dee8169acfa1120c3f83a471 /src/mongo/db/storage | |
parent | f5ee90d15c8f7f723049924d6acc804c6790e278 (diff) | |
download | mongo-d8ac57088d8eae13cf4bed7d9232bddea27e8052.tar.gz |
SERVER-25012 Use non blocking call for opening bulk cursor to WT
Diffstat (limited to 'src/mongo/db/storage')
-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 c783f05f7a6..5396ae918f7 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -491,9 +491,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; |