szetszwo commented on code in PR #1625:
URL: https://github.com/apache/ratis/pull/1625#discussion_r4174800223
##########
ratis-server/src/test/java/org/apache/ratis/LogAppenderTests.java:
##########
@@ -317,12 +317,14 @@ void
runTestNewAppendEntriesRequestAfterPurge(RaftServer.Division leader,
final Stream<LogAppender> appenders =
RaftServerTestUtil.getLogAppenders(leader);
Assertions.assertNotNull(appenders, "Leader should have log appenders");
- final LogAppender appender = appenders.findFirst().orElseThrow(
+ final LogAppender runningAppender = appenders.findFirst().orElseThrow(
() -> new AssertionError("No log appender found"));
Assertions.assertTrue(targetNextIndex > RaftLog.LEAST_VALID_LOG_INDEX,
"targetNextIndex should be > LEAST_VALID_LOG_INDEX");
- appender.getFollower().setNextIndex(targetNextIndex);
+ // Do not change the live appender's follower state: replication replies
may update it concurrently.
+ final LogAppender appender = RaftServerTestUtil.newLogAppenderForTesting(
+ leader, runningAppender.getFollower().getPeer(), targetNextIndex);
Review Comment:
@slfan1989 , Question: When does it change the appender's follower state?
All the code below are just Assertions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]