[jira] [Commented] (RATIS-387) Create interactive demo client

2018-11-02 Thread Josh Elser (JIRA)


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

Josh Elser commented on RATIS-387:
--

Attached a WIP patch:
{code:java}
% mvn exec:java 
-Dexec.mainClass=org.apache.ratis.logservice.shell.LogServiceShell 
-Dexec.args="-q localhost:9990,localhost:9991,localhost:9992"
[INFO] Scanning for projects...
[INFO] 
[INFO] Detecting the operating system and CPU architecture
[INFO] 
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.12
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 12
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] -< org.apache.ratis:ratis-logservice >--
[INFO] Building Apache Ratis LogService 0.3.0-SNAPSHOT
[INFO] [ jar ]-
[WARNING] The POM for 
org.apache.ratis:ratis-thirdparty-hadoop:jar:0.1.0-SNAPSHOT is invalid, 
transitive dependencies (if any) will not be available, enable debug logging 
for more details
[INFO]
[INFO] --- exec-maven-plugin:1.3.1:java (default-cli) @ ratis-logservice ---
[WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment 
on MEXEC-6.
logservice> create log1
TODO implement create
logservice> put log1 a
TODO implement put
logservice> read log1
TODO implement read
logservice> delete log1
TODO implement delete
logservice> quit
Bye!
[INFO] 
[INFO] BUILD SUCCESS
[INFO] 
[INFO] Total time: 31.349 s
[INFO] Finished at: 2018-11-02T18:53:22-04:00
[INFO] 
{code}
I need to actually wire up the calls to the state machine – close though. I 
think this will be pretty darn useful.

> Create interactive demo client
> --
>
> Key: RATIS-387
> URL: https://issues.apache.org/jira/browse/RATIS-387
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Josh Elser
>Assignee: Josh Elser
>Priority: Major
> Attachments: RATIS-387.wip.patch
>
>
> I've been thinking about how to give a "compelling" demo for the LogService. 
> I keep coming back to a simple shell that could be used to do simple things 
> like create, read, and write to a log.
> I am thinking something like:
> {code}
> > create 'log1'
> > put 'log1' 'a'
> > put 'log1' 'b'
> > put 'log1' 'c'
> > read 'log1'
> ['a', 'b', 'c']
> > delete 'log'
> {code}
> Users would provide the location of the MetaData service to this shell. 
> Everything else should be auto-magic (in the final version, anyways).
> I think this compliments the docker infra work that [~rajeshbabu] is working 
> on.



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


[jira] [Updated] (RATIS-387) Create interactive demo client

2018-11-02 Thread Josh Elser (JIRA)


 [ 
https://issues.apache.org/jira/browse/RATIS-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser updated RATIS-387:
-
Attachment: RATIS-387.wip.patch

> Create interactive demo client
> --
>
> Key: RATIS-387
> URL: https://issues.apache.org/jira/browse/RATIS-387
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Josh Elser
>Assignee: Josh Elser
>Priority: Major
> Attachments: RATIS-387.wip.patch
>
>
> I've been thinking about how to give a "compelling" demo for the LogService. 
> I keep coming back to a simple shell that could be used to do simple things 
> like create, read, and write to a log.
> I am thinking something like:
> {code}
> > create 'log1'
> > put 'log1' 'a'
> > put 'log1' 'b'
> > put 'log1' 'c'
> > read 'log1'
> ['a', 'b', 'c']
> > delete 'log'
> {code}
> Users would provide the location of the MetaData service to this shell. 
> Everything else should be auto-magic (in the final version, anyways).
> I think this compliments the docker infra work that [~rajeshbabu] is working 
> on.



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


[jira] [Created] (RATIS-391) Create README for logservice

2018-11-02 Thread Josh Elser (JIRA)
Josh Elser created RATIS-391:


 Summary: Create README for logservice
 Key: RATIS-391
 URL: https://issues.apache.org/jira/browse/RATIS-391
 Project: Ratis
  Issue Type: Task
  Components: LogService
Reporter: Josh Elser


Need to create a README for the logservice



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


[jira] [Created] (RATIS-390) Fix java pacakge structure

2018-11-02 Thread Josh Elser (JIRA)
Josh Elser created RATIS-390:


 Summary: Fix java pacakge structure
 Key: RATIS-390
 URL: https://issues.apache.org/jira/browse/RATIS-390
 Project: Ratis
  Issue Type: Task
  Components: LogService
Reporter: Josh Elser


LogStateMachine is contained in the "api" package which makes no sense.

LogServiceClient would be considered client api, but doesn't exist in the "api" 
package.



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


[jira] [Updated] (RATIS-387) Create interactive demo client

2018-11-02 Thread Josh Elser (JIRA)


 [ 
https://issues.apache.org/jira/browse/RATIS-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser updated RATIS-387:
-
Component/s: LogService

> Create interactive demo client
> --
>
> Key: RATIS-387
> URL: https://issues.apache.org/jira/browse/RATIS-387
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Josh Elser
>Assignee: Josh Elser
>Priority: Major
>
> I've been thinking about how to give a "compelling" demo for the LogService. 
> I keep coming back to a simple shell that could be used to do simple things 
> like create, read, and write to a log.
> I am thinking something like:
> {code}
> > create 'log1'
> > put 'log1' 'a'
> > put 'log1' 'b'
> > put 'log1' 'c'
> > read 'log1'
> ['a', 'b', 'c']
> > delete 'log'
> {code}
> Users would provide the location of the MetaData service to this shell. 
> Everything else should be auto-magic (in the final version, anyways).
> I think this compliments the docker infra work that [~rajeshbabu] is working 
> on.



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


[jira] [Commented] (RATIS-375) Enable (and fix if necessary) unit tests.

2018-11-02 Thread Hadoop QA (JIRA)


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

Hadoop QA commented on RATIS-375:
-

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  0m 
17s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Findbugs executables are not available. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 5 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  1m 
 1s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 
47s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
15s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
34s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 
52s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 
47s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  0m 
47s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
13s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
33s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}  4m 43s{color} 
| {color:red} root in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
 7s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black} 10m 19s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | 
ratis.server.simulation.TestServerRestartWithSimulatedRpc |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/ratis:date2018-11-02 
|
| JIRA Issue | RATIS-375 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12946728/RATIS-375.001.patch |
| Optional Tests |  asflicense  javac  javadoc  unit  findbugs  checkstyle  
compile  |
| uname | Linux b2d92fd6dd88 3.13.0-153-generic #203-Ubuntu SMP Thu Jun 14 
08:52:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-RATIS-Build/yetus-personality.sh
 |
| git revision | master / 27c2dfe |
| Default Java | 1.8.0_181 |
| unit | 
https://builds.apache.org/job/PreCommit-RATIS-Build/485/artifact/out/patch-unit-root.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-RATIS-Build/485/testReport/ |
| modules | C: ratis-logservice U: ratis-logservice |
| Console output | 
https://builds.apache.org/job/PreCommit-RATIS-Build/485/console |
| Powered by | Apache Yetus 0.5.0   http://yetus.apache.org |


This message was automatically generated.



> Enable (and fix if necessary) unit tests.
> -
>
> Key: RATIS-375
> URL: https://issues.apache.org/jira/browse/RATIS-375
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Vladimir Rodionov
>Assignee: Josh Elser
>Priority: Major
> Fix For: 0.3.0
>
> Attachments: RATIS-375.001.patch
>
>
> I assigned this ticket to [~sergey.soldatov] to work on TestMetaServer first. 
> When its done, he can reassign this back to me.



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


[jira] [Updated] (RATIS-375) Enable (and fix if necessary) unit tests.

2018-11-02 Thread Josh Elser (JIRA)


 [ 
https://issues.apache.org/jira/browse/RATIS-375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser updated RATIS-375:
-
Attachment: RATIS-375.001.patch

> Enable (and fix if necessary) unit tests.
> -
>
> Key: RATIS-375
> URL: https://issues.apache.org/jira/browse/RATIS-375
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Vladimir Rodionov
>Assignee: Josh Elser
>Priority: Major
> Fix For: 0.3.0
>
> Attachments: RATIS-375.001.patch
>
>
> I assigned this ticket to [~sergey.soldatov] to work on TestMetaServer first. 
> When its done, he can reassign this back to me.



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


[jira] [Assigned] (RATIS-375) Enable (and fix if necessary) unit tests.

2018-11-02 Thread Josh Elser (JIRA)


 [ 
https://issues.apache.org/jira/browse/RATIS-375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser reassigned RATIS-375:


Assignee: Josh Elser  (was: Vladimir Rodionov)

> Enable (and fix if necessary) unit tests.
> -
>
> Key: RATIS-375
> URL: https://issues.apache.org/jira/browse/RATIS-375
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Vladimir Rodionov
>Assignee: Josh Elser
>Priority: Major
>
> I assigned this ticket to [~sergey.soldatov] to work on TestMetaServer first. 
> When its done, he can reassign this back to me.



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


[jira] [Commented] (RATIS-375) Enable (and fix if necessary) unit tests.

2018-11-02 Thread Josh Elser (JIRA)


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

Josh Elser commented on RATIS-375:
--

Knocking this out myself.

Vlad, I know you wanted to add some new tests. Please open a new one to track 
that.

> Enable (and fix if necessary) unit tests.
> -
>
> Key: RATIS-375
> URL: https://issues.apache.org/jira/browse/RATIS-375
> Project: Ratis
>  Issue Type: Sub-task
>  Components: LogService
>Reporter: Vladimir Rodionov
>Assignee: Josh Elser
>Priority: Major
>
> I assigned this ticket to [~sergey.soldatov] to work on TestMetaServer first. 
> When its done, he can reassign this back to me.



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


[jira] [Assigned] (RATIS-387) Create interactive demo client

2018-11-02 Thread Josh Elser (JIRA)


 [ 
https://issues.apache.org/jira/browse/RATIS-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser reassigned RATIS-387:


Assignee: Josh Elser

> Create interactive demo client
> --
>
> Key: RATIS-387
> URL: https://issues.apache.org/jira/browse/RATIS-387
> Project: Ratis
>  Issue Type: Sub-task
>Reporter: Josh Elser
>Assignee: Josh Elser
>Priority: Major
>
> I've been thinking about how to give a "compelling" demo for the LogService. 
> I keep coming back to a simple shell that could be used to do simple things 
> like create, read, and write to a log.
> I am thinking something like:
> {code}
> > create 'log1'
> > put 'log1' 'a'
> > put 'log1' 'b'
> > put 'log1' 'c'
> > read 'log1'
> ['a', 'b', 'c']
> > delete 'log'
> {code}
> Users would provide the location of the MetaData service to this shell. 
> Everything else should be auto-magic (in the final version, anyways).
> I think this compliments the docker infra work that [~rajeshbabu] is working 
> on.



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


[jira] [Commented] (RATIS-381) RaftTestUtil.waitForLeader should not return null

2018-11-02 Thread Hadoop QA (JIRA)


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

Hadoop QA commented on RATIS-381:
-

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  1m 
21s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  0m  
0s{color} | {color:blue} Findbugs executables are not available. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 10 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  0m 
11s{color} | {color:blue} Maven dependency ordering for branch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 
56s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 
48s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 
16s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
34s{color} | {color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:blue}0{color} | {color:blue} mvndep {color} | {color:blue}  0m  
5s{color} | {color:blue} Maven dependency ordering for patch {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 
55s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 
48s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} javac {color} | {color:red}  0m 48s{color} 
| {color:red} root generated 23 new + 0 unchanged - 0 fixed = 23 total (was 0) 
{color} |
| {color:orange}-0{color} | {color:orange} checkstyle {color} | {color:orange}  
0m 15s{color} | {color:orange} root: The patch generated 43 new + 137 unchanged 
- 11 fixed = 180 total (was 148) {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m 
 0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
34s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}  0m 19s{color} 
| {color:red} root in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
 6s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}  7m 18s{color} | 
{color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/ratis:date2018-11-02 
|
| JIRA Issue | RATIS-381 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/12946536/r381_20181101b.patch |
| Optional Tests |  asflicense  javac  javadoc  unit  findbugs  checkstyle  
compile  |
| uname | Linux 75a71d2deeb4 3.13.0-139-generic #188-Ubuntu SMP Tue Jan 9 
14:43:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | 
/home/jenkins/jenkins-slave/workspace/PreCommit-RATIS-Build/yetus-personality.sh
 |
| git revision | master / 27c2dfe |
| Default Java | 1.8.0_181 |
| javac | 
https://builds.apache.org/job/PreCommit-RATIS-Build/484/artifact/out/diff-compile-javac-root.txt
 |
| checkstyle | 
https://builds.apache.org/job/PreCommit-RATIS-Build/484/artifact/out/diff-checkstyle-root.txt
 |
| unit | 
https://builds.apache.org/job/PreCommit-RATIS-Build/484/artifact/out/patch-unit-root.txt
 |
|  Test Results | 
https://builds.apache.org/job/PreCommit-RATIS-Build/484/testReport/ |
| modules | C: ratis-common ratis-server ratis-grpc U: . |
| Console output | 
https://builds.apache.org/job/PreCommit-RATIS-Build/484/console |
| Powered by | Apache Yetus 0.5.0   http://yetus.apache.org |


This message was automatically generated.



> RaftTestUtil.waitForLeader should not return null
> -
>
> Key: RATIS-381
> URL: https://issues.apache.org/jira/browse/RATIS-381
> Project: Ratis
>  Issue Type: Improvement
>  Components: test
>Reporter: Tsz Wo Nicholas Sze
>Assignee: Tsz Wo 

[jira] [Comment Edited] (RATIS-362) Add a Builder for TransactionContext

2018-11-02 Thread Shashikant Banerjee (JIRA)


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

Shashikant Banerjee edited comment on RATIS-362 at 11/2/18 10:44 AM:
-

Thanks [~szetszwo], for the patch. The patch looks good to me. Just one minor 
comment:

In TransactionContext , can we also have a public setter function called 
setException (we already have getException exposed), so that, we can set the 
exception inside the stateMachine in case the startTransaction fails, the 
exception can be set and properly handled here in RaftServerImpl:
{code:java}
// TODO: this client request will not be added to pending requests until
// later which means that any failure in between will leave partial state in
// the state machine. We should call cancelTransaction() for failed requests
TransactionContext context = stateMachine.startTransaction(request);
if (context.getException() != null) {
  RaftClientReply exceptionReply = new RaftClientReply(request,
  new StateMachineException(getId(), context.getException()), 
getCommitInfos());
  cacheEntry.failWithReply(exceptionReply);
  return CompletableFuture.completedFuture(exceptionReply);
}
{code}
 


was (Author: shashikant):
Thanks [~szetszwo], for the patch. The patch looks good to me. Just one minor 
comment:

In TransactionContext , can we also have a setter function called setException 
(we already have getException exposed), so that, we can set the exception 
inside the stateMachine in case the startTransaction fails, the exception can 
be set and properly handled here in RaftServerImpl:
{code:java}
// TODO: this client request will not be added to pending requests until
// later which means that any failure in between will leave partial state in
// the state machine. We should call cancelTransaction() for failed requests
TransactionContext context = stateMachine.startTransaction(request);
if (context.getException() != null) {
  RaftClientReply exceptionReply = new RaftClientReply(request,
  new StateMachineException(getId(), context.getException()), 
getCommitInfos());
  cacheEntry.failWithReply(exceptionReply);
  return CompletableFuture.completedFuture(exceptionReply);
}
{code}
 

> Add a Builder for TransactionContext
> 
>
> Key: RATIS-362
> URL: https://issues.apache.org/jira/browse/RATIS-362
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Tsz Wo Nicholas Sze
>Assignee: Tsz Wo Nicholas Sze
>Priority: Major
> Attachments: r362_20181027.patch
>
>
> Currently, we use TransactionContextImpl constructors to create 
> TransactionContext objects.  Howerver, TransactionContextImpl is supposed to 
> be internal but not a public API.  It is better to add a Builder for 
> TransactionContext.  The Builder is a public API.



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


[jira] [Created] (RATIS-389) Unexpected State in Segmented RaftLog while shutting down LeaderState

2018-11-02 Thread Mukul Kumar Singh (JIRA)
Mukul Kumar Singh created RATIS-389:
---

 Summary: Unexpected State in Segmented RaftLog while shutting down 
LeaderState
 Key: RATIS-389
 URL: https://issues.apache.org/jira/browse/RATIS-389
 Project: Ratis
  Issue Type: Bug
  Components: server
Reporter: Mukul Kumar Singh
Assignee: Mukul Kumar Singh


After shutting down the leaderState, the Log Appender throws the following 
exception.

{code}
2018-11-02 06:00:11,500 INFO org.apache.ratis.server.impl.RaftServerImpl: 
2dd779ad-06e5-4dfa-9228-664511cc2d18 closes. The last applied log index is 57969
2018-11-02 06:00:11,500 ERROR org.apache.ratis.server.impl.LogAppender: 
GrpcLogAppender(2dd779ad-06e5-4dfa-9228-664511cc2d18 -> 
30150210-575a-4bd8-b6f2-62a56d2d0a8b) unexpected exception
java.lang.IllegalArgumentException: 
2dd779ad-06e5-4dfa-9228-664511cc2d18-SegmentedRaftLog is expected to be opened 
but it is CLOSED
at 
org.apache.ratis.util.OpenCloseState.assertOpen(OpenCloseState.java:63)
at 
org.apache.ratis.server.storage.RaftLog.checkLogState(RaftLog.java:80)
at 
org.apache.ratis.server.storage.SegmentedRaftLog.get(SegmentedRaftLog.java:175)
at 
org.apache.ratis.server.storage.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:200)
at 
org.apache.ratis.server.impl.LogAppender.createRequest(LogAppender.java:207)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:152)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.runAppenderImpl(GrpcLogAppender.java:96)
at 
org.apache.ratis.server.impl.LogAppender.runAppender(LogAppender.java:100)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.ratis.util.OpenCloseState$CloseTrace: Close 
2dd779ad-06e5-4dfa-9228-664511cc2d18-SegmentedRaftLog
at 
org.apache.ratis.util.OpenCloseState.lambda$close$1(OpenCloseState.java:109)
at 
java.util.concurrent.atomic.AtomicReference.getAndUpdate(AtomicReference.java:160)
at org.apache.ratis.util.OpenCloseState.close(OpenCloseState.java:109)
at org.apache.ratis.server.storage.RaftLog.close(RaftLog.java:336)
at 
org.apache.ratis.server.storage.SegmentedRaftLog.close(SegmentedRaftLog.java:425)
at org.apache.ratis.server.impl.ServerState.close(ServerState.java:388)
at 
org.apache.ratis.server.impl.RaftServerImpl.lambda$shutdown$3(RaftServerImpl.java:260)
at 
org.apache.ratis.util.LifeCycle.checkStateAndClose(LifeCycle.java:219)
at 
org.apache.ratis.server.impl.RaftServerImpl.shutdown(RaftServerImpl.java:237)
at 
org.apache.ratis.server.impl.RaftServerProxy.lambda$groupRemoveAsync$12(RaftServerProxy.java:387)
at 
java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
at 
java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:614)
at 
java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:1983)
at 
org.apache.ratis.server.impl.RaftServerProxy.groupRemoveAsync(RaftServerProxy.java:385)
at 
org.apache.ratis.server.impl.RaftServerProxy.groupManagementAsync(RaftServerProxy.java:348)
at 
org.apache.ratis.grpc.server.GrpcAdminProtocolService.lambda$groupManagement$0(GrpcAdminProtocolService.java:42)
at org.apache.ratis.grpc.GrpcUtil.asyncCall(GrpcUtil.java:115)
at 
org.apache.ratis.grpc.server.GrpcAdminProtocolService.groupManagement(GrpcAdminProtocolService.java:42)
at 
org.apache.ratis.proto.grpc.AdminProtocolServiceGrpc$MethodHandlers.invoke(AdminProtocolServiceGrpc.java:361)
at 
org.apache.ratis.thirdparty.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:171)
at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:283)
at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:707)
at 
org.apache.ratis.thirdparty.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at 
org.apache.ratis.thirdparty.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more
{code}



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