[SERVER-70394] Fix self-swap in MultiPlanStage::removeRejectedPlans Created: 10/Oct/22  Updated: 29/Oct/23  Resolved: 10/Oct/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.15, 6.0.4, 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Ivan Fefer Assignee: Ivan Fefer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-10-17
Participants:
Linked BF Score: 135

 Description   

In if statement here we should check _backupPlanIdx, not _bestPlanIdx https://github.com/mongodb/mongo/blob/1d93d09948c29534f7c82950ba7771ac0f4da22c/src/mongo/db/exec/multi_plan.cpp#L367

It is relatively harmless, but causes debug mode to show errors, because of an old C++ standard issue: https://stackoverflow.com/questions/22915325/avoiding-self-assignment-in-stdshuffle



 Comments   
Comment by Githook User [ 02/Dec/22 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-70394 Fix self-swap in MultiPlanStage::removeRejectedPlans

(cherry picked from commit df498b17710f364a853c4dc1731cbdc6ec91e0f5)
Branch: v5.0
https://github.com/mongodb/mongo/commit/16576b522b4cde4200e01817c154654b90d41d56

Comment by Githook User [ 02/Dec/22 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-70394 Fix self-swap in MultiPlanStage::removeRejectedPlans

(cherry picked from commit df498b17710f364a853c4dc1731cbdc6ec91e0f5)
Branch: v6.0
https://github.com/mongodb/mongo/commit/d3e569ea57fab877c9e2b9036c13100828c1e4b3

Comment by Githook User [ 10/Oct/22 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-70394 Fix self-swap in MultiPlanStage::removeRejectedPlans
Branch: master
https://github.com/mongodb/mongo/commit/df498b17710f364a853c4dc1731cbdc6ec91e0f5

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