45. 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:
题目选项
- A.It blocks indefinitely, because the write concern could not be confirmed.
- B.It is eventually acknowledged by 2 nodes, but the write concern is not confirmed in the wtimeout window.
- C.It is acknowledged by 2 nodes, and the write concern is successfully confirmed in the wtimeout window.
答案置信度:高
正确答案:B、C
解析语言:中文
w:2 要求写被 2 个节点确认:若在 wtimeout(4000ms) 内完成确认即为 C;若窗口内未确认成功而客户端收到写关注超时错误,但数据其实已复制到 2 个节点,即为 B。A 错:指定了 wtimeout 就不会无限期阻塞。