Dear all,
mongo 5.0.4 shard cluster, how to update shard key.
I am searching in google several days, i still do not get the answer.
first> i try to use : db.table01.updateOne({id:1},{$set:{id:8888}}) (id is my hashed shard key)
i get the error:Must run update to shard key field in a multi-statement transaction or with retryWrites: true."
then> try :db.table01.update({id:1},{$set:{id:8888}},{multi:true})
get the error:Multi-update operations are not allowed when updating the shard key field
then>I login mongos using mongo --retrywrites true, try : db.table01.updateOne({id:1},{$set:{id:8888}})
i get the error:Update operation was converted into a distributed transaction because the document being updated would move shards and that transaction failed. :: caused by :: Transaction was aborted :: caused by :: from shard rs_shard03 :: caused by :: ‘prepareTransaction’ is not supported for replica sets with arbiters"