[SERVER-60948] Insert document in new collection in migration_id_index.js to await successful index build on secondary Created: 22/Oct/21 Updated: 29/Oct/23 Resolved: 25/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.11, 5.0.4, 5.1.0-rc2, 5.1.0-rc3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ali Mir | Assignee: | Ali Mir |
| 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 | ||||||||||||||||
| Backport Requested: |
v5.1, v5.0, v4.4
|
||||||||||||||||
| Sprint: | Repl 2021-11-01 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 39 | ||||||||||||||||
| Description |
|
In migration_id_index.js, we create an empty collection and then attempt to migrate it from shard 0 to shard 1. We then verify the _id index is built on both shard1 primary and secondary. When building an index, the replica set primary will wait until all voting members have successfully built the index before committing it (two-phase index build). However, for empty collections, we have an optimization where we don't wait for the _id index to be built. Instead, we rely on the createIndex command to be propagated via the oplog. As a result, in the test, we don't wait for the index to be built on the secondary node before we attempt to verify it exists (even with majority write concern). We should simply insert a document into the collection at the beginning of the test, so that the index build is two-phase. |
| Comments |
| Comment by Githook User [ 03/Nov/21 ] |
|
Author: {'name': 'ali-mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}Message: (cherry picked from commit 3c4e656176c73f1510531d23b59ee58acba3b492) |
| Comment by Githook User [ 02/Nov/21 ] |
|
Author: {'name': 'ali-mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}Message: (cherry picked from commit 3c4e656176c73f1510531d23b59ee58acba3b492) |
| Comment by Githook User [ 02/Nov/21 ] |
|
Author: {'name': 'ali-mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}Message: (cherry picked from commit 3c4e656176c73f1510531d23b59ee58acba3b492) |
| Comment by Githook User [ 25/Oct/21 ] |
|
Author: {'name': 'ali-mir', 'email': 'ali.mir@mongodb.com', 'username': 'ali-mir'}Message: |