Hi Minh, Thread PromoteNode need read and take action base on latest value of role_. There is only one node give up (set role_ QUIESCED), another node will promote. Role_ could be UNDEFINED at begin of thread PromoteNode() then change to QUIESCED before PromoteNode reach "...active anyway".
There is a very rare case that if peer info response come late somehow cause no give up on both nodes then dual active can happen. But at least, the current patches help reduce very much chance dual active happen. Best Regards, ThuanTr -----Original Message----- From: Minh Hon Chau <minh.c...@dektech.com.au> Sent: Friday, May 22, 2020 7:12 AM To: Thuan Tran <thuan.t...@dektech.com.au>; Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>; Gary Lee <gary....@dektech.com.au> Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 2/2] rde: avoid dual active controllers in relax promotion mode [#3188] Hi Thuan, the role_ being checked in this PromoteNode thread can be changed to QUIESCED from SetPeerState() in mainthead, it could happen due to a race of thread, timing of mds msg, thus rde will not promote the node. I think we can read role_ in mainthread, where the thread PromoteNode is started, and pass it to PromoteNode, to avoid the role_ being changed. Would it still work? Thanks Minh On 21/5/20 2:52 pm, thuan.tran wrote: > Node already give up promotion has set role to QUIESCED should not > promote active anyway, it will cause dual active controllers. > --- > src/rde/rded/role.cc | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/rde/rded/role.cc b/src/rde/rded/role.cc > index a3a969b66..8c941b55d 100644 > --- a/src/rde/rded/role.cc > +++ b/src/rde/rded/role.cc > @@ -110,6 +110,10 @@ void Role::PromoteNode(const uint64_t cluster_size, > return; > } else if (rc != SA_AIS_OK && relaxed_mode == true) { > LOG_WA("Unable to set active controller in consensus service"); > + if (role_ == PCS_RDA_QUIESCED) { > + LOG_WA("Another controller is already promoted"); > + return; > + } > LOG_WA("Will become active anyway"); > promotion_pending = true; > } else if (rc != SA_AIS_OK) { _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel