[SERVER-15281] UnorderedFastKeyTable methods size() and empty() incorrect if elements erased Created: 17/Sep/14  Updated: 11/Jul/16  Resolved: 18/Sep/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.7.7

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

UnorderedFastKeyTable<>::erase() does not update member variable _size. As a result, a successful call to erase() will leave the map in a corrupt state: any subsequent calls to size() will include erased members in the returned count, and any subsequent calls to empty() will never return true.

Callers of size() or empty() on instantiations of StringMap or BSONElementMap are potentially affected.



 Comments   
Comment by Githook User [ 18/Sep/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-15281 UnorderedFastKeyTable<>::erase() correctly update _size
Branch: master
https://github.com/mongodb/mongo/commit/ebae193cfdc69cc0da9b5e417a97215747a6248a

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