[SERVER-40965] createIndexes should set the latest optime on its opCtx to meet writeConcern if no indexes are found to need building Created: 02/May/19 Updated: 29/Oct/23 Resolved: 03/Jul/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Benety Goh |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Execution Team 2019-07-15 | ||||||||
| Participants: | |||||||||
| Description |
|
I haven't tested this, only code inspection, but createIndexes returns OK if it find all indexes to already exist / be being built. I don't see any code setting the latest optime on the opCtx, so I think we are not going to wait for writeConcern correctly if no writes are done by the operation thread. Foreground index builds would have been misbehaving, since they could block behind other foreground builds and then see that everything is already built and return without a write. With This would be a longstanding issue, if it does exist. |
| Comments |
| Comment by Githook User [ 03/Jul/19 ] |
|
Author: {'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}Message: |
| Comment by Benety Goh [ 02/Jul/19 ] |
|
The JS test noop_writes_wait_for_write_concern.js contains a createIndexes test case that seems to cover the scenario described in this ticket. This test was added, together with some fixes for write concern handling across all commands, in |