-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to target upsert by query :: could not extract exact shard key #380
Labels
enhancement
New feature or request
Comments
你启用了upsert吧?分片集群由于目的端写入mongos,而源端同步过来是不带shard key的,导致会报错。建议关闭upsert |
优化:后续会考虑统一采用change stream,插入会携带shard key,以避免这个问题,不过短期内不会优化 |
upsert恰好更新shard key的话,需要启用retryWrites,但是目前mgo的driver还不支持。但是另外一方面来说,upsert更新了shard key,产生的oplog可能是一个普通的Update,也可能是一个delete+insert:
对于这种情况,天然可以处理。
|
vinllen
added a commit
that referenced
this issue
Oct 24, 2020
计划2.4.17版本发布,上面存在的问题需要等待mgo驱动的更新才可以完全解决。
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景:两个分片集群同步,源是3.4.2版本,目的是4.2.0版本
问题:incr同步过程中一直报Failed to target upsert by query :: could not extract exact shard key这个错误
The text was updated successfully, but these errors were encountered: