16. Consider a replica set with 3 healthy data bearing nodes of equal priority and no arbiters. Which of the following will cause a failover event or trigger an election for a new primary? Check all that apply:
题目选项
- A.rs.status()
- B.rs.freeze()
- C.rs.stepDown()
- D.A network partition between the primary and the other nodes
- E.A rolling version upgrade of the current primary node
答案置信度:高
正确答案:C、D、E
解析语言:中文
rs.stepDown() 会主动让出 primary,对当前主节点做滚动版本升级也必然先让它下线/降级,两者都会触发重新选举;而主节点与其他节点之间发生网络分区时,主节点失去多数派联系会降级为 secondary,剩余节点选出新主,同样是 failover。C 的 rs.status() 只是只读查询状态,E 的 rs.freeze() 只让节点在一段时间内不参与竞选(维护时通常还要再配合 rs.stepDown() 才会真正降级),二者都不会触发选举。