[SERVER-23921] audit the use of SortedDataInterface::Cursor::seek for full index traversal in our tests Created: 25/Apr/16  Updated: 04/Sep/19  Resolved: 04/Sep/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.3.5
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Robert Guo (Inactive) Assignee: Haley Connelly
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2019-09-09
Participants:

 Description   

There are a number of places where we traverse an index by seeking to kMinBSONKey:

for (auto entry = cursor->seek(kMinBSONKey, true); entry; i++, entry = cursor->next()) 

This is correct only for non-compound indexes and may confuse future readers who may want to use it for traversing a generic index. Whenever possible, we should seek to BSONObj() instead of kMinBSONKey; this will seek to the leftmost document in the index, regardless of the index type.



 Comments   
Comment by Githook User [ 04/Sep/19 ]

Author:

{'username': 'haleyConnelly', 'email': 'haley.connelly@10gen.com', 'name': 'Haley Connelly'}

Message: SERVER-23921 audit the use of SortedDataInterface::Cursor::seek for full index traversal in our tests
Branch: master
https://github.com/mongodb/mongo/commit/02e8e17e9e04eb017f4493f0cf6fb9b62a6e1615

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