[SERVER-45351] Newly-elected primaries can commit index builds with inconsistencies due to ignoring indexing errors as secondary Created: 03/Jan/20 Updated: 29/Oct/23 Resolved: 30/Jan/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gregory Wlodarek | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | After applying the patch with 'git am < bf.patch', run 'python buildscripts/resmoke.py --suites=no_passthrough jsTests/noPassthrough/repro.js' (This patch was taken from base c92e20479618b22355b9fb7efa935ff6db5883a9).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Execution Team 2020-01-27, Execution Team 2020-02-10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Looking at the code, it looks like the issue stems from IndexBuildsCoordinator::onStepUp() as it commits index builds regardless of whether they should be aborted. I was able to reproduce this, but here is a timeline of events leading up to this problem:
|
| Comments |
| Comment by Louis Williams [ 30/Jan/20 ] |
|
Note: this ticket did not fix all problems with constraint checking and failover. I filed |
| Comment by Githook User [ 30/Jan/20 ] |
|
Author: {'name': 'Louis Williams', 'username': 'louiswilliams', 'email': 'louis.williams@mongodb.com'}Message: |
| Comment by Louis Williams [ 23/Jan/20 ] |
|
This is really a duplicate of The fundamental problem is that a secondary which ignores indexing errors can become primary and finish and index build without certain entries. |
| Comment by Benety Goh [ 23/Jan/20 ] |
|
|
| Comment by Louis Williams [ 06/Jan/20 ] |
|
It is correct for a newly stepped-up primary to commit an index build it started as a secondary. We should investigate why the index build succeeded on the new primary, because it should have failed. The primary and secondary should either both abort or both commit because they built the index with the same data. This implies that the new primary skipped or didn't see the invalid document that caused the index build to fail. |