[SERVER-15483] Calling advanceTo() with key where cursor is positioned hangs in mmapv1 Created: 01/Oct/14  Updated: 02/Aug/18  Resolved: 20/Apr/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.7.6
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-17635 Improve SortedDataInterface::Cursor API Closed
Participants:

 Description   

Relevant snippet of test case extracted below:

scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() );
scoped_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface() );
 
scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
 
WriteUnitOfWork uow( opCtx.get() );
sorted->insert( opCtx.get(), key1, loc1, false );
uow.commit();
 
scoped_ptr<SortedDataInterface::Cursor> cursor( sorted->newCursor( opCtx.get(), 1 ) );
cursor->locate( key1, loc1 );
 
vector<const BSONElement*> keyEnd( 1 );
vector<bool> keyEndInclusive( 1 );
 
cursor->advanceTo( key1, 1, false, keyEnd, keyEndInclusive );

The hang only occurs when advanceTo() is called on the key where the cursor is currently positioned, and that is the last entry in the index. For example, calling cursor->advanceTo(key2, 1, false, keyEnd, keyEndInclusive) instead positions the cursor correctly at EOF.



 Comments   
Comment by Mathias Stearn [ 20/Apr/15 ]

No longer an issues after API changes from SERVER-17635.

Generated at Thu Feb 08 03:38:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.