Commit c0c8966
authored
REP-5274 Compare full index specs rather than just a subset. (#50)
Previously migration-verifier only checked the parts of index specs that go in a mongo.IndexSpecification. That struct is incomplete, though; it doesn’t, for example, include partial index filters. Thus, migration-verifier didn’t compare those parts of an index specification.
This changeset alters the index-checking logic to check full index specifications. Note that this comparison is rather “coarse” and may flag some specifications as mismatching when they actually produce the same index. For example, `{foo: 1}` and `{foo: 2}` actually produce the same index, but migration-verifier will flag them as mismatches. Eventually we hope to fix that, but for now false positives are safer than incomplete checks.
This does teach index verification to ignore type differences, which is a common source of false-positives in verifications. For example, `{_id: Double(1)}` vs. `{_id: Long(1)}` will no longer be flagged as a mismatch. (NB: Due to this change, the metadata DB must now be on a v6+ cluster.)
This also replaces use of mongo.CollectionSpecification with a struct that allows detection of unrecognized fields. Thus we’ll avoid a similar problem for collection specifications.
This also copies over mongosync’s Option implementation.1 parent a4086df commit c0c8966
File tree
8 files changed
+976
-257
lines changed- internal
- util
- verifier
- option
8 files changed
+976
-257
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments