MongoDB DBA · Question 264 · Multiple choice

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:

Answer options

  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.

Answer confidence: High

Correct answer: A, C

Explanation language: Chinese

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

Papers containing this question

This question appears in 3 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗