首页 > 解决方案 > 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 将此属性传递给分片。任何线索将不胜感激!

标签: mongodbspring-bootspring-data-mongodb

解决方案


推荐阅读