[ 
https://issues.apache.org/jira/browse/RATIS-573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16870809#comment-16870809
 ] 

Tsz Wo Nicholas Sze commented on RATIS-573:
-------------------------------------------

+1 the 07 patch looks good.

There is an off indentation in SegmentedRaftLogWorker and two assert calls 
should be changed to more specific API.
{code}
diff --git 
a/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
 
b/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
index 0f84237e..c4f6aa97 100644
--- 
a/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
+++ 
b/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
@@ -243,7 +243,7 @@ class SegmentedRaftLogWorker implements Runnable {
         if (task != null) {
           try {
             if (logIOException != null) {
-             throw logIOException;
+              throw logIOException;
             } else {
               task.execute();
             }
diff --git 
a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
 
b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
index 3ef24512..cda10439 100644
--- 
a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
+++ 
b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
@@ -533,7 +533,7 @@ public class TestSegmentedRaftLog extends BaseTest {
         LOG.info("Test StateMachine : Ratis log failed notification received, "
             + "as expected. Transition to PAUSED state.");
 
-        Assert.assertTrue(entry != null);
+        Assert.assertNotNull(entry);
 
         lifeCycle.transition(LifeCycle.State.PAUSING);
         lifeCycle.transition(LifeCycle.State.PAUSED);
@@ -555,7 +555,7 @@ public class TestSegmentedRaftLog extends BaseTest {
       }
     }
     Assert.assertNotNull(ex);
-    Assert.assertTrue(sm.getLifeCycleState() == LifeCycle.State.PAUSED);
+    Assert.assertSame(LifeCycle.State.PAUSED, sm.getLifeCycleState());
     throw ex;
   }
{code}
Will change them when committing the patch.

> Handle Raft Log Append Failure
> ------------------------------
>
>                 Key: RATIS-573
>                 URL: https://issues.apache.org/jira/browse/RATIS-573
>             Project: Ratis
>          Issue Type: Improvement
>          Components: server
>            Reporter: Supratim Deka
>            Assignee: Supratim Deka
>            Priority: Major
>         Attachments: RATIS-573.00.patch, RATIS-573.01.patch, 
> RATIS-573.02.patch, RATIS-573.03.patch, RATIS-573.04.patch, 
> RATIS-573.05.patch, RATIS-573.06.patch, RATIS-573.07.patch
>
>
> As part of Handling IO Failures, HDDS-1595.
> The scope of this jira is to handle failure in RAFT log append by:
> 1. notify the error to the state machine for consumer specific handling
> 2. propagate the error to the initiator (to the client from leader, to the 
> leader from follower).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to