summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-10-16 16:13:21 -0400
committerMathias Stearn <mathias@10gen.com>2014-10-17 20:34:41 -0400
commit5496425827e4a2fd883c6c429ea09fa410632fcb (patch)
treeebd65e84cf8c49920fbefec96663d381c1f82452
parent3c54ca1f58084845b7f778bde2f8a0f2138f727e (diff)
downloadmongo-5496425827e4a2fd883c6c429ea09fa410632fcb.tar.gz
SERVER-13635 lift tailable out of StorageEngine API and handle in query layer.
-rw-r--r--src/mongo/db/catalog/collection.cpp4
-rw-r--r--src/mongo/db/catalog/collection.h4
-rw-r--r--src/mongo/db/clientcursor.h2
-rw-r--r--src/mongo/db/exec/collection_scan.cpp69
-rw-r--r--src/mongo/db/exec/collection_scan.h5
-rw-r--r--src/mongo/db/query/new_find.cpp38
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.cpp1
-rw-r--r--src/mongo/db/storage/heap1/heap1_test.cpp2
-rw-r--r--src/mongo/db/storage/heap1/record_store_heap.cpp5
-rw-r--r--src/mongo/db/storage/heap1/record_store_heap.h1
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp1
-rw-r--r--src/mongo/db/storage/mmap_v1/heap_record_store_btree.h1
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp1
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_capped.h2
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp1
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple.h2
-rw-r--r--src/mongo/db/storage/mmap_v1/repair_database.cpp5
-rw-r--r--src/mongo/db/storage/record_store.h6
-rw-r--r--src/mongo/db/storage/record_store_test_harness.cpp1
-rw-r--r--src/mongo/db/storage/record_store_test_recorditer.cpp4
-rw-r--r--src/mongo/db/storage/rocks/rocks_record_store.cpp5
-rw-r--r--src/mongo/db/storage/rocks/rocks_record_store.h1
-rw-r--r--src/mongo/dbtests/query_stage_and.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_fetch.cpp3
-rw-r--r--src/mongo/dbtests/query_stage_keep.cpp3
-rw-r--r--src/mongo/dbtests/query_stage_merge_sort.cpp5
-rw-r--r--src/mongo/dbtests/query_stage_sort.cpp3
-rw-r--r--src/mongo/dbtests/repltests.cpp15
29 files changed, 100 insertions, 95 deletions
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp
index fbd5ac4b833..d4b0c3689e2 100644
--- a/src/mongo/db/catalog/collection.cpp
+++ b/src/mongo/db/catalog/collection.cpp
@@ -130,10 +130,9 @@ namespace mongo {
RecordIterator* Collection::getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const {
invariant( ok() );
- return _recordStore->getIterator( txn, start, tailable, dir );
+ return _recordStore->getIterator( txn, start, dir );
}
vector<RecordIterator*> Collection::getManyIterators( OperationContext* txn ) const {
@@ -143,7 +142,6 @@ namespace mongo {
int64_t Collection::countTableScan( OperationContext* txn, const MatchExpression* expression ) {
scoped_ptr<RecordIterator> iterator( getIterator( txn,
DiskLoc(),
- false,
CollectionScanParams::FORWARD ) );
int64_t count = 0;
while ( !iterator->isEOF() ) {
diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h
index 4f2ec5bf95d..fa5a6831be1 100644
--- a/src/mongo/db/catalog/collection.h
+++ b/src/mongo/db/catalog/collection.h
@@ -138,12 +138,10 @@ namespace mongo {
// ---- things that should move to a CollectionAccessMethod like thing
/**
- * canonical to get all would be
- * getIterator( DiskLoc(), false, CollectionScanParams::FORWARD )
+ * Default arguments will return all items in the collection.
*/
RecordIterator* getIterator( OperationContext* txn,
const DiskLoc& start = DiskLoc(),
- bool tailable = false,
const CollectionScanParams::Direction& dir = CollectionScanParams::FORWARD ) const;
/**
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h
index a30b734a70f..f906c915913 100644
--- a/src/mongo/db/clientcursor.h
+++ b/src/mongo/db/clientcursor.h
@@ -153,6 +153,8 @@ namespace mongo {
// Storage engine state for getMore.
//
+ bool hasRecoveryUnit() const { return _ownedRU.get() || _unownedRU; }
+
/**
*
* If a ClientCursor is created via DBDirectClient, it uses the same storage engine
diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp
index ce153c3a1ac..51574d515c2 100644
--- a/src/mongo/db/exec/collection_scan.cpp
+++ b/src/mongo/db/exec/collection_scan.cpp
@@ -54,7 +54,7 @@ namespace mongo {
_workingSet(workingSet),
_filter(filter),
_params(params),
- _nsDropped(false),
+ _isDead(false),
_commonStats(kStageType) {
// Explain reports the direction of the collection scan.
_specificStats.direction = params.direction;
@@ -66,19 +66,35 @@ namespace mongo {
// Adds the amount of time taken by work() to executionTimeMillis.
ScopedTimer timer(&_commonStats.executionTimeMillis);
- if (_nsDropped) { return PlanStage::DEAD; }
+ if (_isDead) { return PlanStage::DEAD; }
// Do some init if we haven't already.
if (NULL == _iter) {
if ( _params.collection == NULL ) {
- _nsDropped = true;
+ _isDead = true;
return PlanStage::DEAD;
}
- _iter.reset( _params.collection->getIterator( _txn,
- _params.start,
- _params.tailable,
- _params.direction ) );
+ if (_lastSeenLoc.isNull()) {
+ _iter.reset( _params.collection->getIterator( _txn,
+ _params.start,
+ _params.direction ) );
+ }
+ else {
+ invariant(_params.tailable);
+
+ _iter.reset( _params.collection->getIterator( _txn,
+ _lastSeenLoc,
+ _params.direction ) );
+
+ // Advance _iter past where we were last time. If it returns something else, mark us
+ // as dead since we want to signal an error rather than silently dropping data from
+ // the stream. This is related to the _lastSeenLock handling in invalidate.
+ if (_iter->getNext() != _lastSeenLoc) {
+ _isDead = true;
+ return PlanStage::DEAD;
+ }
+ }
++_commonStats.needTime;
return PlanStage::NEED_TIME;
@@ -87,24 +103,20 @@ namespace mongo {
// What we'll return to the user.
DiskLoc nextLoc;
- // Should we try getNext() on the underlying _iter if we're EOF? Yes, if we're tailable.
- if (isEOF()) {
- if (!_params.tailable) {
- return PlanStage::IS_EOF;
- }
- else {
- // See if _iter gives us anything new.
- nextLoc = _iter->getNext();
- if (nextLoc.isNull()) {
- // Nope, still EOF.
- return PlanStage::IS_EOF;
- }
- }
- }
- else {
- nextLoc = _iter->getNext();
+ // Should we try getNext() on the underlying _iter?
+ if (isEOF())
+ return PlanStage::IS_EOF;
+
+ // See if _iter gives us anything new.
+ nextLoc = _iter->getNext();
+ if (nextLoc.isNull()) {
+ if (_params.tailable)
+ _iter.reset(); // pick up where we left off on the next call to work()
+ return PlanStage::IS_EOF;
}
+ _lastSeenLoc = nextLoc;
+
WorkingSetID id = _workingSet->allocate();
WorkingSetMember* member = _workingSet->get(id);
member->loc = nextLoc;
@@ -129,8 +141,9 @@ namespace mongo {
if ((0 != _params.maxScan) && (_specificStats.docsTested >= _params.maxScan)) {
return true;
}
- if (_nsDropped) { return true; }
+ if (_isDead) { return true; }
if (NULL == _iter) { return false; }
+ if (_params.tailable) { return false; } // tailable cursors can return data later.
return _iter->isEOF();
}
@@ -149,6 +162,12 @@ namespace mongo {
if (NULL != _iter) {
_iter->invalidate(dl);
}
+
+ if (_params.tailable && dl == _lastSeenLoc) {
+ // This means that deletes have caught up to the reader. We want to error in this case
+ // so readers don't miss potentially important data.
+ _isDead = true;
+ }
}
void CollectionScan::saveState() {
@@ -164,7 +183,7 @@ namespace mongo {
if (NULL != _iter) {
if (!_iter->restoreState(opCtx)) {
warning() << "Collection dropped or state deleted during yield of CollectionScan";
- _nsDropped = true;
+ _isDead = true;
}
}
}
diff --git a/src/mongo/db/exec/collection_scan.h b/src/mongo/db/exec/collection_scan.h
index 48f779293e1..bb6e498d628 100644
--- a/src/mongo/db/exec/collection_scan.h
+++ b/src/mongo/db/exec/collection_scan.h
@@ -90,8 +90,9 @@ namespace mongo {
CollectionScanParams _params;
- // True if Database::getCollection(_ns) == NULL on our first call to work.
- bool _nsDropped;
+ bool _isDead;
+
+ DiskLoc _lastSeenLoc;
// Stats
CommonStats _commonStats;
diff --git a/src/mongo/db/query/new_find.cpp b/src/mongo/db/query/new_find.cpp
index e5ff128aa7f..e091193dc37 100644
--- a/src/mongo/db/query/new_find.cpp
+++ b/src/mongo/db/query/new_find.cpp
@@ -241,9 +241,16 @@ namespace mongo {
// Restore the RecoveryUnit if we need to.
if (fromDBDirectClient) {
- invariant(txn->recoveryUnit() == cc->getUnownedRecoveryUnit());
+ if (cc->hasRecoveryUnit())
+ invariant(txn->recoveryUnit() == cc->getUnownedRecoveryUnit());
}
else {
+ if (!cc->hasRecoveryUnit()) {
+ // Start using a new RecoveryUnit
+ cc->setOwnedRecoveryUnit(
+ getGlobalEnvironment()->getGlobalStorageEngine()->newRecoveryUnit(txn));
+
+ }
// Swap RecoveryUnit(s) between the ClientCursor and OperationContext.
ruSwapper.reset(new ScopedRecoveryUnitSwapper(cc, txn));
}
@@ -305,15 +312,6 @@ namespace mongo {
}
}
- if (PlanExecutor::IS_EOF == state && 0 == numResults
- && (queryOptions & QueryOption_CursorTailable)
- && (queryOptions & QueryOption_AwaitData) && (pass < 1000)) {
- // If the cursor is tailable we don't kill it if it's eof. We let it try to get
- // data some # of times first.
- exec->saveState();
- return 0;
- }
-
// We save the client cursor when there might be more results, and hence we may receive
// another getmore. If we receive a EOF or an error, or 'exec' is dead, then we know
// that we will not be producing more results. We indicate that the cursor is closed by
@@ -375,6 +373,22 @@ namespace mongo {
<< PlanExecutor::statestr(state)
<< endl;
+ if (PlanExecutor::IS_EOF == state && (queryOptions & QueryOption_CursorTailable)) {
+ if (!fromDBDirectClient) {
+ // Don't stash the RU. Get a new one on the next getMore.
+ ruSwapper.reset();
+ delete cc->releaseOwnedRecoveryUnit();
+ }
+
+ if ((queryOptions & QueryOption_AwaitData)
+ && (numResults == 0)
+ && (pass < 1000)) {
+ // Bubble up to the AwaitData handling code in receivedGetMore which will
+ // try again.
+ return NULL;
+ }
+ }
+
// Possibly note slave's position in the oplog.
if ((queryOptions & QueryOption_OplogReplay) && !slaveReadTill.isNull()) {
cc->slaveReadTill(slaveReadTill);
@@ -806,6 +820,10 @@ namespace mongo {
if (fromDBDirectClient) {
cc->setUnownedRecoveryUnit(txn->recoveryUnit());
}
+ else if (state == PlanExecutor::IS_EOF && pq.getOptions().tailable) {
+ // Don't stash the RU for tailable cursors at EOF, let them get a new RU on their
+ // next getMore.
+ }
else {
// We stash away the RecoveryUnit in the ClientCursor. It's used for subsequent
// getMore requests. The calling OpCtx gets a fresh RecoveryUnit.
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
index cc3786a08b8..d6f1e8fa0af 100644
--- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
+++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp
@@ -116,7 +116,6 @@ namespace mongo {
virtual RecordIterator* getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir ) const {
return new EmptyRecordIterator();
}
diff --git a/src/mongo/db/storage/heap1/heap1_test.cpp b/src/mongo/db/storage/heap1/heap1_test.cpp
index a9f21e5f587..f1481ac8cc5 100644
--- a/src/mongo/db/storage/heap1/heap1_test.cpp
+++ b/src/mongo/db/storage/heap1/heap1_test.cpp
@@ -117,6 +117,7 @@ namespace {
}
+#if 0
TEST( Heap1RecordStore, CappedTailable ) {
HeapRecordStore rs( "a.b", true, 1000, 3 );
@@ -159,5 +160,6 @@ namespace {
ASSERT( it->isEOF() );
}
+#endif
}
diff --git a/src/mongo/db/storage/heap1/record_store_heap.cpp b/src/mongo/db/storage/heap1/record_store_heap.cpp
index 631b5ba4ac6..01cf8d9f694 100644
--- a/src/mongo/db/storage/heap1/record_store_heap.cpp
+++ b/src/mongo/db/storage/heap1/record_store_heap.cpp
@@ -236,13 +236,10 @@ namespace mongo {
RecordIterator* HeapRecordStore::getIterator(OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const {
- if (tailable)
- invariant(_isCapped && dir == CollectionScanParams::FORWARD);
if (dir == CollectionScanParams::FORWARD) {
- return new HeapRecordIterator(txn, _records, *this, start, tailable);
+ return new HeapRecordIterator(txn, _records, *this, start, false);
}
else {
return new HeapRecordReverseIterator(txn, _records, *this, start);
diff --git a/src/mongo/db/storage/heap1/record_store_heap.h b/src/mongo/db/storage/heap1/record_store_heap.h
index 2b30d2f1316..937774ca0a3 100644
--- a/src/mongo/db/storage/heap1/record_store_heap.h
+++ b/src/mongo/db/storage/heap1/record_store_heap.h
@@ -85,7 +85,6 @@ namespace mongo {
virtual RecordIterator* getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const;
virtual RecordIterator* getIteratorForRepair( OperationContext* txn ) const;
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
index a444dc71dc3..1a12c3fafad 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
@@ -208,7 +208,6 @@ namespace mongo {
scoped_ptr<RecordIterator> iterator( _namespaceRecordStore->getIterator( txn,
DiskLoc(),
- false,
CollectionScanParams::FORWARD ) );
while ( !iterator->isEOF() ) {
DiskLoc loc = iterator->getNext();
diff --git a/src/mongo/db/storage/mmap_v1/heap_record_store_btree.h b/src/mongo/db/storage/mmap_v1/heap_record_store_btree.h
index 079cb2be1ca..a0a3ce47cad 100644
--- a/src/mongo/db/storage/mmap_v1/heap_record_store_btree.h
+++ b/src/mongo/db/storage/mmap_v1/heap_record_store_btree.h
@@ -93,7 +93,6 @@ namespace mongo {
virtual RecordIterator* getIterator(OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const {
invariant(false);
}
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
index 39c455250b9..4a43e60c73d 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
@@ -664,7 +664,6 @@ namespace mongo {
scoped_ptr<RecordIterator> iterator( getIterator( txn,
DiskLoc(),
- false,
CollectionScanParams::FORWARD ) );
DiskLoc cl;
while ( !( cl = iterator->getNext() ).isNull() ) {
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
index c6e7cfe6cef..f81a45b13f4 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
@@ -596,9 +596,8 @@ namespace mongo {
RecordIterator* CappedRecordStoreV1::getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const {
- return new CappedRecordStoreV1Iterator( txn, this, start, tailable, dir );
+ return new CappedRecordStoreV1Iterator( txn, this, start, false, dir );
}
vector<RecordIterator*> CappedRecordStoreV1::getManyIterators( OperationContext* txn ) const {
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.h b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.h
index 2983d5d75e9..ff7402e583d 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.h
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.h
@@ -63,7 +63,7 @@ namespace mongo {
virtual void temp_cappedTruncateAfter( OperationContext* txn, DiskLoc end, bool inclusive );
virtual RecordIterator* getIterator( OperationContext* txn,
- const DiskLoc& start, bool tailable,
+ const DiskLoc& start,
const CollectionScanParams::Direction& dir) const;
virtual std::vector<RecordIterator*> getManyIterators( OperationContext* txn ) const;
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
index c1c3dab27db..c3703dfb763 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
@@ -238,7 +238,6 @@ namespace mongo {
RecordIterator* SimpleRecordStoreV1::getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir) const {
return new SimpleRecordStoreV1Iterator( txn, this, start, dir );
}
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.h b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.h
index 0da006163e8..ce03af14f25 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.h
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.h
@@ -50,7 +50,7 @@ namespace mongo {
const char* name() const { return "SimpleRecordStoreV1"; }
- virtual RecordIterator* getIterator( OperationContext* txn, const DiskLoc& start, bool tailable,
+ virtual RecordIterator* getIterator( OperationContext* txn, const DiskLoc& start,
const CollectionScanParams::Direction& dir) const;
virtual std::vector<RecordIterator*> getManyIterators(OperationContext* txn) const;
diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp
index a34fd1bd29d..9fce4a4eca2 100644
--- a/src/mongo/db/storage/mmap_v1/repair_database.cpp
+++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp
@@ -336,7 +336,6 @@ namespace mongo {
if ( coll ) {
scoped_ptr<RecordIterator> it( coll->getIterator( txn,
DiskLoc(),
- false,
CollectionScanParams::FORWARD ) );
while ( !it->isEOF() ) {
DiskLoc loc = it->getNext();
@@ -401,9 +400,7 @@ namespace mongo {
return status;
}
- scoped_ptr<RecordIterator> iterator(
- originalCollection->getIterator( txn, DiskLoc(), false,
- CollectionScanParams::FORWARD ));
+ scoped_ptr<RecordIterator> iterator(originalCollection->getIterator(txn));
while ( !iterator->isEOF() ) {
DiskLoc loc = iterator->getNext();
invariant( !loc.isNull() );
diff --git a/src/mongo/db/storage/record_store.h b/src/mongo/db/storage/record_store.h
index cdcd3c8857e..dcdfca84c29 100644
--- a/src/mongo/db/storage/record_store.h
+++ b/src/mongo/db/storage/record_store.h
@@ -186,14 +186,12 @@ namespace mongo {
const mutablebson::DamageVector& damages ) = 0;
/**
* returned iterator owned by caller
- * canonical to get all would be
- * getIterator( txn, DiskLoc(), false, CollectionScanParams::FORWARD )
+ * Default arguments return all items in record store.
*/
virtual RecordIterator* getIterator( OperationContext* txn,
const DiskLoc& start = DiskLoc(),
- bool tailable = false,
const CollectionScanParams::Direction& dir =
- CollectionScanParams::FORWARD
+ CollectionScanParams::FORWARD
) const = 0;
/**
diff --git a/src/mongo/db/storage/record_store_test_harness.cpp b/src/mongo/db/storage/record_store_test_harness.cpp
index fc0e414334d..83eee87db40 100644
--- a/src/mongo/db/storage/record_store_test_harness.cpp
+++ b/src/mongo/db/storage/record_store_test_harness.cpp
@@ -423,7 +423,6 @@ namespace mongo {
scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
scoped_ptr<RecordIterator> it( rs->getIterator( opCtx.get(),
DiskLoc(),
- false,
CollectionScanParams::BACKWARD ) );
while ( !it->isEOF() ) {
DiskLoc loc = it->getNext();
diff --git a/src/mongo/db/storage/record_store_test_recorditer.cpp b/src/mongo/db/storage/record_store_test_recorditer.cpp
index 924586d2d15..ed11f4762be 100644
--- a/src/mongo/db/storage/record_store_test_recorditer.cpp
+++ b/src/mongo/db/storage/record_store_test_recorditer.cpp
@@ -85,7 +85,6 @@ namespace mongo {
RecordIterator *it = rs->getIterator( opCtx.get(),
DiskLoc(),
- false,
CollectionScanParams::FORWARD );
for ( int i = 0; i < nToInsert; i++ ) {
@@ -147,7 +146,6 @@ namespace mongo {
RecordIterator *it = rs->getIterator( opCtx.get(),
DiskLoc(),
- false,
CollectionScanParams::BACKWARD );
for ( int i = nToInsert - 1; i >= 0; i-- ) {
@@ -209,7 +207,6 @@ namespace mongo {
int start = nToInsert / 2;
RecordIterator *it = rs->getIterator( opCtx.get(),
locs[start],
- false,
CollectionScanParams::FORWARD );
for ( int i = start; i < nToInsert; i++ ) {
@@ -271,7 +268,6 @@ namespace mongo {
int start = nToInsert / 2;
RecordIterator *it = rs->getIterator( opCtx.get(),
locs[start],
- false,
CollectionScanParams::BACKWARD );
for ( int i = start; i >= 0; i-- ) {
diff --git a/src/mongo/db/storage/rocks/rocks_record_store.cpp b/src/mongo/db/storage/rocks/rocks_record_store.cpp
index 5c400aceb49..3780b455525 100644
--- a/src/mongo/db/storage/rocks/rocks_record_store.cpp
+++ b/src/mongo/db/storage/rocks/rocks_record_store.cpp
@@ -285,10 +285,9 @@ namespace mongo {
RecordIterator* RocksRecordStore::getIterator( OperationContext* txn,
const DiskLoc& start,
- bool tailable,
const CollectionScanParams::Direction& dir
) const {
- return new Iterator(txn, _db, _columnFamily, tailable, dir, start);
+ return new Iterator(txn, _db, _columnFamily, false, dir, start);
}
@@ -445,7 +444,7 @@ namespace mongo {
DiskLoc end,
bool inclusive ) {
boost::scoped_ptr<RecordIterator> iter(
- getIterator( txn, maxDiskLoc, false, CollectionScanParams::BACKWARD ) );
+ getIterator( txn, maxDiskLoc, CollectionScanParams::BACKWARD ) );
while( !iter->isEOF() ) {
WriteUnitOfWork wu( txn );
diff --git a/src/mongo/db/storage/rocks/rocks_record_store.h b/src/mongo/db/storage/rocks/rocks_record_store.h
index 42612a45a3b..44f6a35f2f7 100644
--- a/src/mongo/db/storage/rocks/rocks_record_store.h
+++ b/src/mongo/db/storage/rocks/rocks_record_store.h
@@ -109,7 +109,6 @@ namespace mongo {
virtual RecordIterator* getIterator( OperationContext* txn,
const DiskLoc& start = DiskLoc(),
- bool tailable = false,
const CollectionScanParams::Direction& dir =
CollectionScanParams::FORWARD ) const;
diff --git a/src/mongo/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp
index ddc255bfce0..c2e3a3630fb 100644
--- a/src/mongo/dbtests/query_stage_and.cpp
+++ b/src/mongo/dbtests/query_stage_and.cpp
@@ -73,7 +73,7 @@ namespace QueryStageAnd {
}
void getLocs(set<DiskLoc>* out, Collection* coll) {
- RecordIterator* it = coll->getIterator(&_txn, DiskLoc(), false,
+ RecordIterator* it = coll->getIterator(&_txn, DiskLoc(),
CollectionScanParams::FORWARD);
while (!it->isEOF()) {
DiskLoc nextLoc = it->getNext();
diff --git a/src/mongo/dbtests/query_stage_fetch.cpp b/src/mongo/dbtests/query_stage_fetch.cpp
index cee92839240..cd06b3e6fdb 100644
--- a/src/mongo/dbtests/query_stage_fetch.cpp
+++ b/src/mongo/dbtests/query_stage_fetch.cpp
@@ -57,8 +57,7 @@ namespace QueryStageFetch {
}
void getLocs(set<DiskLoc>* out, Collection* coll) {
- RecordIterator* it = coll->getIterator(&_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD);
+ RecordIterator* it = coll->getIterator(&_txn);
while (!it->isEOF()) {
DiskLoc nextLoc = it->getNext();
out->insert(nextLoc);
diff --git a/src/mongo/dbtests/query_stage_keep.cpp b/src/mongo/dbtests/query_stage_keep.cpp
index ef4d9bf8d1c..2bb6373d865 100644
--- a/src/mongo/dbtests/query_stage_keep.cpp
+++ b/src/mongo/dbtests/query_stage_keep.cpp
@@ -61,8 +61,7 @@ namespace QueryStageKeep {
}
void getLocs(set<DiskLoc>* out, Collection* coll) {
- RecordIterator* it = coll->getIterator(&_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD);
+ RecordIterator* it = coll->getIterator(&_txn);
while (!it->isEOF()) {
DiskLoc nextLoc = it->getNext();
out->insert(nextLoc);
diff --git a/src/mongo/dbtests/query_stage_merge_sort.cpp b/src/mongo/dbtests/query_stage_merge_sort.cpp
index c4221846a56..ab4c027aaf7 100644
--- a/src/mongo/dbtests/query_stage_merge_sort.cpp
+++ b/src/mongo/dbtests/query_stage_merge_sort.cpp
@@ -74,10 +74,7 @@ namespace QueryStageMergeSortTests {
}
void getLocs(set<DiskLoc>* out, Collection* coll) {
- RecordIterator* it = coll->getIterator(&_txn,
- DiskLoc(),
- false,
- CollectionScanParams::FORWARD);
+ RecordIterator* it = coll->getIterator(&_txn);
while (!it->isEOF()) {
DiskLoc nextLoc = it->getNext();
out->insert(nextLoc);
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp
index cc4e9363073..20834444537 100644
--- a/src/mongo/dbtests/query_stage_sort.cpp
+++ b/src/mongo/dbtests/query_stage_sort.cpp
@@ -66,8 +66,7 @@ namespace QueryStageSortTests {
}
void getLocs(set<DiskLoc>* out, Collection* coll) {
- RecordIterator* it = coll->getIterator(&_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD);
+ RecordIterator* it = coll->getIterator(&_txn);
while (!it->isEOF()) {
DiskLoc nextLoc = it->getNext();
out->insert(nextLoc);
diff --git a/src/mongo/dbtests/repltests.cpp b/src/mongo/dbtests/repltests.cpp
index 40b411e9998..c013594f4da 100644
--- a/src/mongo/dbtests/repltests.cpp
+++ b/src/mongo/dbtests/repltests.cpp
@@ -141,8 +141,7 @@ namespace ReplTests {
}
int count = 0;
- RecordIterator* it = coll->getIterator( &_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD );
+ RecordIterator* it = coll->getIterator(&_txn);
for ( ; !it->isEOF(); it->getNext() ) {
++count;
}
@@ -162,8 +161,7 @@ namespace ReplTests {
}
int count = 0;
- RecordIterator* it = coll->getIterator( &_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD );
+ RecordIterator* it = coll->getIterator(&_txn);
for ( ; !it->isEOF(); it->getNext() ) {
++count;
}
@@ -179,8 +177,7 @@ namespace ReplTests {
Database* db = ctx.db();
Collection* coll = db->getCollection( &_txn, cllNS() );
- RecordIterator* it = coll->getIterator( &_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD );
+ RecordIterator* it = coll->getIterator(&_txn);
while ( !it->isEOF() ) {
DiskLoc currLoc = it->getNext();
ops.push_back(coll->docFor(&_txn, currLoc));
@@ -213,8 +210,7 @@ namespace ReplTests {
coll = db->createCollection( &_txn, ns );
}
- RecordIterator* it = coll->getIterator( &_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD );
+ RecordIterator* it = coll->getIterator(&_txn);
::mongo::log() << "all for " << ns << endl;
while ( !it->isEOF() ) {
DiskLoc currLoc = it->getNext();
@@ -235,8 +231,7 @@ namespace ReplTests {
}
vector< DiskLoc > toDelete;
- RecordIterator* it = coll->getIterator( &_txn, DiskLoc(), false,
- CollectionScanParams::FORWARD );
+ RecordIterator* it = coll->getIterator(&_txn);
while ( !it->isEOF() ) {
toDelete.push_back( it->getNext() );
}