[COMPASS-5721] Query for sharded findAndModify must contain the shard key Created: 12/Apr/22 Updated: 27/Oct/23 Resolved: 20/Jun/22 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Compass |
| Affects Version/s: | 1.31.1, 1.31.2 |
| Fix Version/s: | No version |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Joel J | Assignee: | Le Roux Bodenstein |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 10 |
||
| Attachments: |
|
| Documentation Changes: | Not Needed |
| Description |
| Comments |
| Comment by Joel J [ 15/Jun/22 ] |
|
I see. One possibility is that the bug is fixed is the current version. A lot of releases have been made in the last weeks. Maybe something has fixed this... I don't have the bug any more. |
| Comment by Le Roux Bodenstein [ 15/Jun/22 ] |
|
I did my testing by sharding with HASH. Hard to see why the method would matter, though - the code that loads the shard keys and passes them along when updating doesn't care about that detail. My hunch was that it was something to do with the deeply nested path to the key, but haven't been able to reproduce anything there yet. |
| Comment by Joel J [ 15/Jun/22 ] |
|
Hi there, Unfortunately, I don't have the configuration any more. And I can't provide this log. Sorry. This issue was submitted 2 months ago, and I had to find a workaround. I sharded the collection with method RANGE instead of HASH, and the bug disappeared. In your test, do you shard the table with the method HASH? Because it may be the trigger of the bug. Regards. |
| Comment by Le Roux Bodenstein [ 14/Jun/22 ] |
|
Thank you for filing this issue. We do support updating docs with the shard key and it is supposed to just work automatically. I just tried to recreate this and all my tests so far have worked just fine. I'm thinking there might be some edge case here unique to your situation.
The code that loads the shard keys so we can make sure those get included does log a warning if it fails, so if you can send us your compass log file we might be able to spot something in there to help us reproduce this issue. |