[SERVER-54825] Use 'toArray()' in addition to array access after 'find()' in rslib.js Created: 26/Feb/21  Updated: 29/Oct/23  Resolved: 02/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.4.10

Type: Bug Priority: Major - P3
Reporter: Hana Pearlman Assignee: Hartek Sabharwal
Resolution: Fixed Votes: 0
Labels: greenerbuild
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-55162 Retry getting 'firstOplogEntry' in op... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Participants:
Linked BF Score: 21

 Description   

If we use coll.find().toArray()[0] instead of just coll.find()[0] then we will be able to catch the CappedPositionLost error as expected in getFirstOplogEntry().

(This doesn't solve the direct cause of the bug in the linked ticket, but it will avoid the bug in the future.)



 Comments   
Comment by Githook User [ 23/Sep/21 ]

Author:

{'name': 'Hartek Sabharwal', 'email': 'hartek.sabharwal@mongodb.com', 'username': 'tectonic8'}

Message: SERVER-54825 Use 'toArray()' in addition to array access after 'find()' in rslib.js
Branch: v4.4
https://github.com/mongodb/mongo/commit/801fc62596caee9c1c5aa6b4edf1a3e2ee857690

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Hartek Sabharwal', 'email': 'hartek.sabharwal@mongodb.com', 'username': 'tectonic8'}

Message: SERVER-54825 Use 'toArray()' in addition to array access after 'find()' in rslib.js
Branch: master
https://github.com/mongodb/mongo/commit/f561673aa5662bbead507e7f02003c0a3d7bfa9e

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