[COMPASS-4715] 'prepareTransaction' is not supported for replica sets with arbiters Created: 16/Mar/21  Updated: 27/Oct/23  Resolved: 08/Feb/23

Status: Closed
Project: Compass
Component/s: Compass, CRUD
Affects Version/s: 1.26.0
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Kaushik Das Assignee: Unassigned
Resolution: Works as Designed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB 4.2.3 Community
All Installed in Ubuntu 18 LTS
2Shards, each shard have PSA nodes
One mongos router


Attachments: PNG File image-2021-03-16-19-13-49-788.png     PNG File image-2021-03-16-19-18-32-520.png    
Issue Links:
Related
is related to SERVER-64462 更新shard key并abortTransaction得到报错并导致mo... Closed
is related to COMPASS-4478 Support for updates in sharded collec... Closed
Documentation Changes: Not Needed
UserVoice Links:

Error

1) Update operation was converted into a distributed transaction because the document being updated would move shards and that transaction failed. :: caused by :: from shard shard one :: caused by :: 'prepareTransaction' is not supported for replica sets with arbiters
2)Query for sharded findAndModify must contain the shard key

 

connection string in compass : &w=1&readConcernLevel=linearizable&readPreference=primary&appname=MongoDB%20Compass&retryWrites=true&directConnection=false&ssl=false
 


 Description   

Problem Description

1) We have 2 shards and each shard have PSA architecture in MongoDB 4.2.3 Community, while updating shard key from the compass, compass is throwing this error.

My connection String parameters  &w=1&readConcernLevel=linearizable&readPreference=primary&appname=MongoDB%20Compass&retryWrites=true&directConnection=false&ssl=false

2) While updating other field it is showing "

Query for sharded findAndModify must contain the shard key
 " this error

Steps to Reproduce

Expected Results

Actual Results

Additional Notes



 Comments   
Comment by Maurizio Casimirri [ 08/Feb/23 ]

kaushik.phpcoder@gmail.com transactions have a known limitation with shards and PSAs. Transactions whose write operations span multiple shards will error and abort if any transaction operation reads from or writes to a shard that contains an arbiter: https://www.mongodb.com/docs/manual/core/transactions-sharded-clusters/#multiple-shards

I'm going to close this as "Work as designed" as it is not a Compass issue. Feel free to open a SERVER ticket in the future if you have similar issues.

Comment by Anna Henningsen [ 02/Dec/22 ]

Confirmed that:

  • The first issue still persists (including with 6.2.0-alpha server versions).
  • The second issue has been addressed in COMPASS-4478.

Practically speaking though, it seems like there is nothing that Compass could do about the first issue here.

Comment by Jessica Sigafoos [ 04/May/22 ]

Hi kaushik.phpcoder@gmail.com, following up on this.  Are you still seeing this issue with the latest version of Compass?  We believe the second issue was resolved by COMPASS-4478, and are wondering if you're still seeing the first issue. Thanks!

Comment by Jessica Sigafoos [ 07/Apr/22 ]

Hi kaushik.phpcoder@gmail.com, are you still seeing this issue with the latest version of Compass? Thanks!

Comment by Jessica Sigafoos [ 23/Mar/22 ]

kaushik.phpcoder@gmail.com are you still seeing this issue with the latest version of Compass?  Thanks!

Comment by Kaushik Das [ 30/Mar/21 ]

for 1st case Same error is coming while doing the update on shell.
But not in 2nd case.

Comment by Massimiliano Marcon [ 24/Mar/21 ]

kaushik.phpcoder@gmail.com
For both 1 and 2, are you able to do the same update operation from the shell?

Generated at Wed Feb 07 22:37:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.