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.A network partition between the primary and the other nodes
- B.rs.status()
- C.rs.stepDown() A rolling version upgrade of the current primary node
- D.rs.freeze()
答案置信度:中
正确答案:A、C
解析语言:中文
主节点与其余节点网络分区后,剩下的多数派(2/3)会选出新主,属典型 failover;rs.stepDown() 主动让位、以及滚动升级中让主节点让位的步骤同样会触发选举,所以选 A 与 C(C 这一项在源文件里把 rs.stepDown() 与 “A rolling version upgrade of the current primary node” 合并成了一项,两者都会触发选举)。rs.status() 只是查询状态;rs.freeze() 的设计目的是让成员在一段时间内不参选,不是主动触发选举——流传的两份答案键在 freeze 上彼此矛盾,故本条判 medium。