File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/io/openmessaging/storage/dledger Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,9 @@ private void maintainAsCandidate() throws Exception {
396396 long term ;
397397 long ledgerEndTerm ;
398398 long ledgerEndIndex ;
399+ if (!memberState .isCandidate ()) {
400+ return ;
401+ }
399402 synchronized (memberState ) {
400403 if (!memberState .isCandidate ()) {
401404 return ;
@@ -443,9 +446,6 @@ private void maintainAsCandidate() throws Exception {
443446 case ACCEPT :
444447 acceptedNum .incrementAndGet ();
445448 break ;
446- case REJECT_ALREADY_VOTED :
447- case REJECT_TAKING_LEADERSHIP :
448- break ;
449449 case REJECT_ALREADY_HAS_LEADER :
450450 alreadyHasLeader .compareAndSet (false , true );
451451 break ;
@@ -462,6 +462,8 @@ private void maintainAsCandidate() throws Exception {
462462 case REJECT_TERM_NOT_READY :
463463 notReadyTermNum .incrementAndGet ();
464464 break ;
465+ case REJECT_ALREADY_VOTED :
466+ case REJECT_TAKING_LEADERSHIP :
465467 default :
466468 break ;
467469
You can’t perform that action at this time.
0 commit comments