@@ -84,6 +84,10 @@ public long getCurrentTerm() {
84
84
return currentTerm ;
85
85
}
86
86
87
+ boolean canHandleClientValue () {
88
+ return electionWon && publishPermitted ;
89
+ }
90
+
87
91
public boolean isQuorumInCurrentConfiguration (NodeCollection votes ) {
88
92
final HashSet <String > intersection = new HashSet <>(committedState .getVotingNodes ().nodes .keySet ());
89
93
intersection .retainAll (votes .nodes .keySet ());
@@ -157,7 +161,7 @@ public Optional<PublishRequest<T>> handleVote(DiscoveryNode sourceNode, Vote vot
157
161
"current last accepted term " + lastAcceptedTerm );
158
162
}
159
163
160
- logger .debug ("handleVote: adding vote {} from [{}] for election at slot {}" , vote , sourceNode . getId () , firstUncommittedSlot ());
164
+ logger .debug ("handleVote: adding vote {} from [{}] for election at slot {}" , vote , sourceNode , firstUncommittedSlot ());
161
165
joinVotes .add (sourceNode );
162
166
163
167
electionWon = isQuorumInCurrentConfiguration (joinVotes );
@@ -233,7 +237,7 @@ public Optional<ApplyCommit> handlePublishResponse(DiscoveryNode sourceNode, Pub
233
237
}
234
238
235
239
logger .trace ("handlePublishResponse: accepted publish response for slot [{}] and term [{}] from [{}]" ,
236
- publishResponse .getSlot (), publishResponse .getTerm (), sourceNode . getId () );
240
+ publishResponse .getSlot (), publishResponse .getTerm (), sourceNode );
237
241
publishVotes .add (sourceNode );
238
242
if (isQuorumInCurrentConfiguration (publishVotes )) {
239
243
logger .trace ("handlePublishResponse: value committed for slot [{}] and term [{}]" ,
0 commit comments