MongoDB DBA · 题目 264 · 多选

42. Consider the following write operation issued to a MongoDB replica set: db.users.insert( { "name": "Akash", "birthday": ISODate("1986-10-27T00:00:00Z") }, { "w": 2, "wtimeout": 4000 } ) What are the possible outcomes of this write operation? Check all that apply:

题目选项

  1. A.
    It is eventually acknowledged by 2 nodes, but the write concern is not confirmed in the wtimeout window.
  2. B.
    It blocks indefinitely, because the write concern could not be confirmed.
  3. C.
    It is acknowledged by 2 nodes, and the write concern is successfully confirmed in the wtimeout window.

答案置信度:高

正确答案:A、C

解析语言:中文

w:2 要求写被 2 个节点确认:若在 wtimeout(4000ms) 内完成确认即为 C;若窗口内未确认成功而客户端收到写关注超时错误,但数据其实已复制到 2 个节点,即为 B。A 错:指定了 wtimeout 就不会无限期阻塞。

所在套题

此题在题库中有 3 条记录。公开详情合并相同题干和选项;完整公开题展示置信度最高的一条记录,其他题目仅展示摘要。按套学习保留每条记录原有的答案、解析和置信度。

作者 · 作品 · 开源

作者与 MongoDB 作品

专注数据平台、MongoDB 迁移同步与云运维产品研发。

有任何 MongoDB 需求,均可联系作者。

联系作者 ↗mlhp123@outlook.com

支持作者

如果题库对您有帮助,欢迎自愿扫码打赏。

支付宝扫码打赏作者打开打赏原图 ↗