mongodb - Mongos 与 Mongod 的兼容性问题
问题描述
我在生产环境中运行一个 Sharded Mongo 数据库。
最近,有一次同事弃用了其中一个 Mongos (Router) 实例,并且新实例 (通过 ASG) 生成了最新的 Mongo 4.2 次要版本,即 4.2.14。其余实例(分片、mongos 和配置)继续在 4.2.5 上。
此后不久,我遇到了一个问题,我在网上找不到任何文档。该问题仅发生在具有最新版本 mongos - 4.2.14 的节点上。
Error - Command failed with error 40415 (Location40415): 'BSON field '$mergeCursors.recordRemoteOpWaitTime' is an unknown field.' on server 10.17.9.84:27017. The full response is {"ok": 0.0, "errmsg": "BSON field '$mergeCursors.recordRemoteOpWaitTime' is an unknown field.", "code": 40415, "codeName": "Location40415", "operationTime": {"$timestamp": {"t": 1620920773, "i": 1}}, "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1620920773, "i": 1}}, "signature": {"hash":
{"$binary": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "$type": "00"}
, "keyId": {"$numberLong": "0"}}}}
经过一天的研究,我可以理解,从任何版本 4.2.5(我们目前未知)开始,所有从 mongos 发出的请求都有recordRemoteOpWaitTime: true。由于其余节点低于4.2.13,因此它们无法识别此属性,因此会出错。
我在可用文档中找不到任何对此的参考。我需要找出一种方法来禁用 mongos 将此属性传递给分片。任何线索将不胜感激!
解决方案
推荐阅读
- angular - 如何以角度延迟加载库模块
- r - 如何获得 10 个最有价值的客户(例如,终身订单总数最高的客户)[r]
- ada - 分别指定“Small”和“Delta”是否有意义?
- macos-big-sur - AndroidStudio 在 macOS Big Sur 测试版上崩溃
- functional-programming - 如何正确使用 |> 运算符?
- ios - Apple 证书,配置文件
- bash - 无法找到可执行文件:Azure Devops Pipeline 上的简单脚本出现“bash”错误
- python - 在pygame中更改显示模式而不关闭游戏
- node.js - 如何使用 joi 库比较两个字符串的相同值
- ruby-on-rails - 正则表达式使用 ruby 从文本中提取段落