[SERVER-28975] Cannot remove document with 2dsphere partialFilter index Created: 26/Apr/17 Updated: 30/Oct/23 Resolved: 08/Feb/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo, Index Maintenance |
| Affects Version/s: | 3.4.4 |
| Fix Version/s: | 3.7.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrei Belashou | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Storage 2018-02-12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Hello, unexpected error occurred while trying to remove document that contains invalid geoJson from collection with partial index:
Partial index is 2dsphere with condition geometry_status >= 0. Inserted document has invalid goeJson but geometry_status = -1 so it can be inserted. But cannot be removed. |
| Comments |
| Comment by Githook User [ 08/Feb/18 ] |
|
Author: {'email': 'louis.williams@mongodb.com', 'name': 'Louis Williams', 'username': 'louiswilliams'}Message: |
| Comment by Louis Williams [ 08/Feb/18 ] |
|
The following commit was made to master with the wrong ticket in the commit message: Message: |
| Comment by Ian Whalen (Inactive) [ 16/Oct/17 ] |
|
louis.williams we're putting this back on the backlog just to make sure it doesn't get lost from the Storage team's view, but please ping me or Eric if you do get spare time and come up with a patch for this. |
| Comment by Louis Williams [ 13/Oct/17 ] |
|
After talking with max.hirschhorn and david.storch use the kRelaxConstraints constant to ignore whitelisted errors when calling IndexAccessMethod::getKeys(). If a whitelisted error is thrown, but the partialIndexFilter applies to the document, then the error will be thrown. |
| Comment by Louis Williams [ 12/Oct/17 ] |
|
It seems like these are the only potential solutions. max.hirschhorn and david.storch let me know if you agree. Solution 3 is a much larger project. 1. On unindex(), check if the partialIndex filter applies to the document. If it doesn't, don't attempt to unindex it.
2. On removal, use the existing kRelaxConstraints constant to ignore all key errors when calling IndexAccessMethod::getKeys().
3. On remove, use the existing kRelaxConstraints, to ignore individual key errors, and pass to the IndexAccessMethod::doGetKeys() virtual function, which all subclasses must implement.
|
| Comment by Eric Milkie [ 26/Apr/17 ] |
|
That's a better workaround. I wasn't sure that that method would work (it may have given a similar error). Thanks for the tip! |
| Comment by Andrei Belashou [ 26/Apr/17 ] |
|
Hi Eric, |
| Comment by Eric Milkie [ 26/Apr/17 ] |
|
Hi Andrei, |