summaryrefslogtreecommitdiff
path: root/src/mongo/db/prefetch.cpp
diff options
context:
space:
mode:
authorCraig Harris <craig.harris@10gen.com>2014-06-25 17:06:03 -0400
committerCraigHarris <craig.harris@10gen.com>2014-07-08 10:53:53 -0400
commit0450a0f25d4509f6515e939a5ef3a671f744cc2a (patch)
treebd5004de51df5ebe4923a6af0863ab5c4b10f8fc /src/mongo/db/prefetch.cpp
parentb1048dc6f42e184c08853fe98c21a90ecfb40d6b (diff)
downloadmongo-0450a0f25d4509f6515e939a5ef3a671f744cc2a.tar.gz
SERVER-14387 Propogate OperationContext through calls requiring document read locks, without doing the locking.
Diffstat (limited to 'src/mongo/db/prefetch.cpp')
-rw-r--r--src/mongo/db/prefetch.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp
index 88ba08716e7..fe2500f4b16 100644
--- a/src/mongo/db/prefetch.cpp
+++ b/src/mongo/db/prefetch.cpp
@@ -1,5 +1,5 @@
/**
-* Copyright (C) 2008 10gen Inc.
+* Copyright (C) 2008-2014 MongoDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
@@ -58,7 +58,8 @@ namespace mongo {
"repl.preload.docs",
&prefetchDocStats );
- void prefetchIndexPages(Collection* collection,
+ void prefetchIndexPages(OperationContext* txn,
+ Collection* collection,
const repl::ReplSetImpl::IndexPrefetchConfig& prefetchConfig,
const BSONObj& obj);
@@ -111,7 +112,7 @@ namespace mongo {
// a way to achieve that would be to prefetch the record first, and then afterwards do
// this part.
//
- prefetchIndexPages(collection, prefetchConfig, obj);
+ prefetchIndexPages(txn, collection, prefetchConfig, obj);
// do not prefetch the data for inserts; it doesn't exist yet
//
@@ -128,7 +129,8 @@ namespace mongo {
}
// page in pages needed for all index lookups on a given object
- void prefetchIndexPages(Collection* collection,
+ void prefetchIndexPages(OperationContext* txn,
+ Collection* collection,
const repl::ReplSetImpl::IndexPrefetchConfig& prefetchConfig,
const BSONObj& obj) {
DiskLoc unusedDl; // unused
@@ -151,7 +153,7 @@ namespace mongo {
return;
IndexAccessMethod* iam = collection->getIndexCatalog()->getIndex( desc );
verify( iam );
- iam->touch(obj);
+ iam->touch(txn, obj);
}
catch (const DBException& e) {
LOG(2) << "ignoring exception in prefetchIndexPages(): " << e.what() << endl;
@@ -170,7 +172,7 @@ namespace mongo {
IndexDescriptor* desc = ii.next();
IndexAccessMethod* iam = collection->getIndexCatalog()->getIndex( desc );
verify( iam );
- iam->touch(obj);
+ iam->touch(txn, obj);
}
catch (const DBException& e) {
LOG(2) << "ignoring exception in prefetchIndexPages(): " << e.what() << endl;