[SERVER-40026] Blacklist distinct in sharded collections in transactions Created: 07/Mar/19 Updated: 29/Oct/23 Resolved: 20/May/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.12 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Gregory McKeon (Inactive) | Assignee: | Ilan Cohen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Sharding 2019-05-06, Sharding 2019-05-20, Sharding 2019-06-03 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Per alyson.cabral, we should do this. This is because distinct is the only command currently allowed in a sharded transaction that does not filter orphaned documents. |
| Comments |
| Comment by Githook User [ 20/May/19 ] | |||||||||||||||||||||||||||||||||
|
Author: {'email': 'jack.mulrow@mongodb.com', 'name': 'Jack Mulrow', 'username': 'jsmulrow'}Message: | |||||||||||||||||||||||||||||||||
| Comment by Alyson Cabral (Inactive) [ 16/May/19 ] | |||||||||||||||||||||||||||||||||
|
To reiterate the in-person conversation, we should just disallow for now. kay.kim will work on making a docs page similar to count with known workarounds. Will you create a docs ticket for this Kay? And then we will link (as depends on) the follow-up ticket that adds that docs link to the error message. The idea is that we would implement syntactic sugar for this in agg in the long term.
| |||||||||||||||||||||||||||||||||
| Comment by Jack Mulrow [ 02/May/19 ] | |||||||||||||||||||||||||||||||||
|
alyson.cabral, do you have a preference on the error message we should return to a user who tries to run "distinct" in a transaction on a sharded collection? For count (which isn't allowed in a transaction at all), we return an error with: "Cannot run 'count' in a multi-document transaction. Please see http://dochub.mongodb.org/core/transaction-count for a recommended alternative." Do we have a similar alternative to recommend here? Or is it fine to return something like "Cannot run 'distinct' in a multi-document transaction on a sharded collection" with no alternative? | |||||||||||||||||||||||||||||||||
| Comment by Jack Mulrow [ 25/Apr/19 ] | |||||||||||||||||||||||||||||||||
|
Yeah I can take this. | |||||||||||||||||||||||||||||||||
| Comment by Gregory McKeon (Inactive) [ 25/Apr/19 ] | |||||||||||||||||||||||||||||||||
|
jack.mulrow can you pick this up? |