Guangcun Li created RATIS-2806:
----------------------------------

             Summary: setConfiguration ADD mode unexpectedly removes existing 
listeners
                 Key: RATIS-2806
                 URL: https://issues.apache.org/jira/browse/RATIS-2806
             Project: Ratis
          Issue Type: Bug
          Components: server
            Reporter: Guangcun Li


h3. 1. Existing listeners are lost in ADD mode

RATIS-1594 introduced ADD mode to preserve existing members. 
{{RaftServerImpl.setConfigurationAsync()}} merges both voting members and 
listeners, but only passes the merged voting-member list to 
{{LeaderStateImpl.startSetConfiguration()}}. The latter reads listeners from 
the original request, discarding the merged listener list.

For a cluster with voting members {{[A, B]}} and listener {{[L]}}, an ADD 
request containing only a new voting member {{D}} succeeds, but produces voting 
members {{[A, B, D]}} with no listeners. The expected listener list is still 
{{[L]}}.

Pass the merged listener list into {{startSetConfiguration()}} together with 
the merged voting-member list, and use both when constructing the target 
configuration.

h3. 2. Redundant constants in RaftLogBase

Since RATIS-1255 separated {{RaftLog}} into an interface and an implementation, 
both {{RaftLog}} and {{RaftLogBase}} declare {{LEAST_VALID_LOG_INDEX}} and 
{{INVALID_LOG_INDEX}} with the same values, {{0}} and {{-1}}.

{{RaftLogBase}} already implements {{RaftLog}}. Remove its redundant constant 
declarations and the associated comment, using the interface definitions.

h3. Verification

* A reproducing test starts two voting members and one listener, then adds a 
voting member using ADD mode without repeating the listener. It confirms that 
the request succeeds and the existing listener is removed.
* {{TestRaftReconfigurationWithGrpc}}, {{TestRaftReconfigurationWithNetty}}, 
and {{TestRaftReconfigurationWithSimulatedRpc}} each pass all 20 tests.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to