szetszwo commented on code in PR #1133:
URL: https://github.com/apache/ratis/pull/1133#discussion_r1714064861
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -469,7 +469,6 @@ boolean inStagingState() {
}
long getCurrentTerm() {
- Preconditions.assertSame(currentTerm, server.getState().getCurrentTerm(),
"currentTerm");
Review Comment:
Instead of removing the assertion, let's passing `currentTerm` directly.
Then, the other calls will have the assertion.
```java
@@ -700,7 +700,7 @@ class LeaderStateImpl implements LeaderState {
}
void submitStepDownEvent(StepDownReason reason) {
- submitStepDownEvent(getCurrentTerm(), reason);
+ submitStepDownEvent(currentTerm, reason);
}
void submitStepDownEvent(long term, StepDownReason reason) {
```
--
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]