[SERVER-39392] Invariant in PlanStage::dispose always evaluates as true Created: 06/Feb/19 Updated: 29/Oct/23 Resolved: 14/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.1, 3.6.20, 4.7.0, 4.0.21 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anton Korshunov | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Backport Requested: |
v4.4, v4.2, v4.0, v3.6
|
||||||||||||||||||||||||
| Sprint: | Dev Platform 2020-08-24 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
Due to a typo in the PlanStage::dispose() invariant it can never be evaluated to false.
The opCtx == opCtx condition should be opCtx == _optCtx. Note that there is a task |
| Comments |
| Comment by Githook User [ 17/Aug/20 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: (cherry picked from commit e908bb6b444235cb251c4e69b5adac9e6a983953) |
| Comment by Githook User [ 17/Aug/20 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: (cherry picked from commit e908bb6b444235cb251c4e69b5adac9e6a983953) |
| Comment by Githook User [ 17/Aug/20 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: (cherry picked from commit e908bb6b444235cb251c4e69b5adac9e6a983953) |
| Comment by Githook User [ 17/Aug/20 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: (cherry picked from commit e908bb6b444235cb251c4e69b5adac9e6a983953) |
| Comment by Githook User [ 14/Aug/20 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: |
| Comment by Andrew Morrow (Inactive) [ 13/Aug/20 ] |
|
Code review URL: https://mongodbcr.appspot.com/637460002/ |
| Comment by Andrew Morrow (Inactive) [ 13/Aug/20 ] |
|
This has become a blocker for |
| Comment by Andrew Morrow (Inactive) [ 05/Aug/20 ] |
|
I'd like to re-open this issue: the indicated code has not yet been removed for other reasons, as was used as a justification for not fixing the issue. The incorrect code does cause issues in practice. We don't see this warning become an error in normal builds because for whatever reason GCC can't see the tautology when it is wrapped in a macro. However, certain combinations of tools like ccache and icecream can alter the preprocessing setup such that the compiler does see the tautology, resulting in failed builds. A future compiler that was better at understanding macro expansions could also begin to issue errors at any time. The fix is trivial, because not only is the invariant tautological, but it is entirely unnecessary due to the assignment immediately before it. |
| Comment by Kelsey Schubert [ 06/Feb/19 ] |
|
It looks like it's been this way since 3.6, do we need to consider backports? |