[SERVER-69517] moveChunk command fails with "Transaction numbers are only allowed on a replica set member or mongos" on Mongo 4.4 mongos without replica sets Created: 08/Sep/22 Updated: 12/Sep/22 Resolved: 12/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.16 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Springer | Assignee: | Chris Kelly |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
We are in the process of upgrading our sharded Mongo cluster from 4.2 to 4.4. In production, we use replica sets, but in dev/test we do not. In dev/test, after upgrading featureCompatibilityVersion to 4.4, a moveChunk command executed from mongos fails with "Transaction numbers are only allowed on a replica set member or mongos". After downgrading to fcv 4.2, the moveChunk command succeeds. I encounter the same error both from the Java driver and mongo shell - in both cases retryable reads and retryable writes are disabled (we have had retryable reads and writes disabled since we upgraded to 4.0, since with them enabled we encountered similar errors about transactions not being supported without replica sets). The error message implies transaction numbers are allowed on mongos, which is where I am executing the command from. It also is unclear why there is a transaction number in the command in the first place. When I set breakpoints in the Java driver and inspect the moveChunk command at various points prior to it being sent to the server, there is no transaction number. |
| Comments |
| Comment by Chris Kelly [ 12/Sep/22 ] |
|
Thank you for linking the documentation that was confusing on this. I will look into how we can improve the clarity there. I'll go ahead and close this ticket for now, but if your issues persist, feel free to @mention me with additional information, or open a separate ticket. Have a great day! |
| Comment by Ian Springer [ 12/Sep/22 ] |
|
Thanks, Chris. We'll try the 1-node replica sets. Note, I think the documentation could use some improvement. I didn't come across anything that said sharded clusters must use replica sets for features X, Y, and Z to function. For example, https://www.mongodb.com/docs/v4.4/sharding/ and https://www.mongodb.com/docs/v4.4/core/sharded-cluster-components/ both suggest replica sets are optional for sharded clusters and only needed for HA. |
| Comment by Chris Kelly [ 12/Sep/22 ] |
|
Hi Ian, Thanks for your report. To answer your question:
This is because new features made in MongoDB 3.6 onward assume that shards run as replica sets. Per Specifically, this exists to improve chunk migrations and orphaned document cleanup resiliency during failover. You can read more about this in: Chunk Migration Failover Resiliency Improvements in 4.4 In your case, we recommend initiating your shards as 1-node replica sets to avoid this going forward (even in your dev/test environment). Let me know if this resolves your issue! Regards, |