[jira] [Assigned] (RATIS-953) XML Parsers should not be vulnerable to XXE attacks

2020-06-15 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai reassigned RATIS-953:
--

Assignee: Attila Doroszlai

> XML Parsers should not be vulnerable to XXE attacks
> ---
>
> Key: RATIS-953
> URL: https://issues.apache.org/jira/browse/RATIS-953
> Project: Ratis
>  Issue Type: Sub-task
>Affects Versions: 0.5.0
>Reporter: Dinesh Chitlangia
>Assignee: Attila Doroszlai
>Priority: Major
>
> [https://sonarcloud.io/project/issues?id=apache_incubator-ratis=false=java%3AS2755=VULNERABILITY]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-639) Inconsistent pattern for variable names

2020-05-03 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-639:
---
Description: 
Numbers are allowed in variable names, but such variables cannot be used in 
expressions:

{noformat}
$ client.sh arithmetic assign --name v1 --value 1
$ client.sh arithmetic assign --name v2 --value 2
$ client.sh arithmetic assign --name v3 --value "v1+v2"
...
Exception in thread "main" java.lang.IllegalArgumentException: Invalid 
expression v1 Try something like: 'a+b' or '2'
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:73)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
{noformat}

Similarly, values like {{0}} and {{0.1}} cannot be used in expressions:

{noformat}
$ client.sh arithmetic assign --name b --value '0.1+1'
... IllegalArgumentException: Invalid expression 0.1+1 Try something like: 
'a+b' or '2'
$ client.sh arithmetic assign --name b --value '0+1'
... 'IllegalArgumentException: Invalid expression 0+1 Try something like: 'a+b' 
or '2'
{noformat}

Also, negative values result in exception:

{noformat}
$ client.sh arithmetic assign --name a --value '-5'
Exception in thread "main" java.lang.NumberFormatException: empty String
at 
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at java.lang.Double.valueOf(Double.java:502)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:61)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
{noformat}

  was:
Numbers are allowed in variable names, but such variables cannot be used in 
expressions:

{noformat}
$ client.sh arithmetic assign --name v1 --value 1
$ client.sh arithmetic assign --name v2 --value 2
$ client.sh arithmetic assign --name v3 --value "v1+v2"
...
Exception in thread "main" java.lang.IllegalArgumentException: Invalid 
expression v1 Try something like: 'a+b' or '2'
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:73)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
{noformat}

Similarly, values like {{0}} and {{0.1}} cannot be used in expressions:

{noformat}
$ client.sh arithmetic assign --name b --value '0.1+1'
... IllegalArgumentException: Invalid expression 0.1+1 Try something like: 
'a+b' or '2'
$ client.sh arithmetic assign --name b --value '0+1
... 'IllegalArgumentException: Invalid expression 0+1 Try something like: 'a+b' 
or '2'
{noformat}

Also, negative values result in exception:

{noformat}
$ client.sh arithmetic assign --name a --value '-5'
Exception in thread "main" java.lang.NumberFormatException: empty String
at 
sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at java.lang.Double.valueOf(Double.java:502)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:61)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
at 
org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
{noformat}


> Inconsistent pattern for variable names
> ---
>
> Key: RATIS-639
> URL: https://issues.apache.org/jira/browse/RATIS-639
> Project: 

[jira] [Assigned] (RATIS-639) Inconsistent pattern for variable names

2020-05-02 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai reassigned RATIS-639:
--

Assignee: Attila Doroszlai

> Inconsistent pattern for variable names
> ---
>
> Key: RATIS-639
> URL: https://issues.apache.org/jira/browse/RATIS-639
> Project: Ratis
>  Issue Type: Bug
>  Components: examples
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Minor
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Numbers are allowed in variable names, but such variables cannot be used in 
> expressions:
> {noformat}
> $ client.sh arithmetic assign --name v1 --value 1
> $ client.sh arithmetic assign --name v2 --value 2
> $ client.sh arithmetic assign --name v3 --value "v1+v2"
> ...
> Exception in thread "main" java.lang.IllegalArgumentException: Invalid 
> expression v1 Try something like: 'a+b' or '2'
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:73)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
>   at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
>   at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
> {noformat}
> Similarly, values like {{0}} and {{0.1}} cannot be used in expressions:
> {noformat}
> $ client.sh arithmetic assign --name b --value '0.1+1'
> ... IllegalArgumentException: Invalid expression 0.1+1 Try something like: 
> 'a+b' or '2'
> $ client.sh arithmetic assign --name b --value '0+1
> ... 'IllegalArgumentException: Invalid expression 0+1 Try something like: 
> 'a+b' or '2'
> {noformat}
> Also, negative values result in exception:
> {noformat}
> $ client.sh arithmetic assign --name a --value '-5'
> Exception in thread "main" java.lang.NumberFormatException: empty String
>   at 
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
>   at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
>   at java.lang.Double.parseDouble(Double.java:538)
>   at java.lang.Double.valueOf(Double.java:502)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:61)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createBinaryExpression(Assign.java:87)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.createExpression(Assign.java:69)
>   at 
> org.apache.ratis.examples.arithmetic.cli.Assign.operation(Assign.java:53)
>   at org.apache.ratis.examples.arithmetic.cli.Client.run(Client.java:51)
>   at org.apache.ratis.examples.common.Runner.main(Runner.java:67)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-889) Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc

2020-04-30 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-889:


Sorry [~yjxxtd], I hadn't noticed that there was another issue (RATIS-848) for 
the same problem and you already have a patch.  It seems we both found the same 
problem and moved the {{takeSnapshot}} metric check earlier in the test.  
Please take a look at my fix, which additionally verifies that snapshot is 
taken while stopping the leader.

> Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc
> -
>
> Key: RATIS-889
> URL: https://issues.apache.org/jira/browse/RATIS-889
> Project: Ratis
>  Issue Type: Sub-task
>  Components: snapshot
>Affects Versions: 0.6.0
>Reporter: Shashikant Banerjee
>Assignee: Attila Doroszlai
>Priority: Major
> Attachments: unit.zip
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code:java}
> Test set: org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> ---
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.84 s <<< 
> FAILURE! - in org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> testBasicInstallSnapshot(org.apache.ratis.grpc.TestRaftSnapshotWithGrpc)  
> Time elapsed: 2.308 s  <<< FAILURE!
> java.lang.AssertionError
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (RATIS-889) Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc

2020-04-30 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai reassigned RATIS-889:
--

Assignee: Attila Doroszlai  (was: runzhiwang)

> Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc
> -
>
> Key: RATIS-889
> URL: https://issues.apache.org/jira/browse/RATIS-889
> Project: Ratis
>  Issue Type: Sub-task
>  Components: snapshot
>Affects Versions: 0.6.0
>Reporter: Shashikant Banerjee
>Assignee: Attila Doroszlai
>Priority: Major
> Fix For: 0.6.0
>
> Attachments: unit.zip
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code:java}
> Test set: org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> ---
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.84 s <<< 
> FAILURE! - in org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> testBasicInstallSnapshot(org.apache.ratis.grpc.TestRaftSnapshotWithGrpc)  
> Time elapsed: 2.308 s  <<< FAILURE!
> java.lang.AssertionError
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-889) Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc

2020-04-30 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-889:
---
Summary: Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc  
(was: Fix TestRaftSnapshotWithGrpc)

> Fix TestRaftSnapshotWithGrpc and TestRaftSnapshotWithSimulatedRpc
> -
>
> Key: RATIS-889
> URL: https://issues.apache.org/jira/browse/RATIS-889
> Project: Ratis
>  Issue Type: Sub-task
>  Components: snapshot
>Affects Versions: 0.6.0
>Reporter: Shashikant Banerjee
>Assignee: runzhiwang
>Priority: Major
> Fix For: 0.6.0
>
> Attachments: unit.zip
>
>
> {code:java}
> Test set: org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> ---
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.84 s <<< 
> FAILURE! - in org.apache.ratis.grpc.TestRaftSnapshotWithGrpc
> testBasicInstallSnapshot(org.apache.ratis.grpc.TestRaftSnapshotWithGrpc)  
> Time elapsed: 2.308 s  <<< FAILURE!
> java.lang.AssertionError
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-915) Improve output of tests

2020-04-30 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-915:
--

 Summary: Improve output of tests
 Key: RATIS-915
 URL: https://issues.apache.org/jira/browse/RATIS-915
 Project: Ratis
  Issue Type: Improvement
  Components: test
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai


I would like to propose the following improvements for unit tests:

# include stack trace for test failures in results
# include thread name in log message format

Example for stack trace:

{code}
---
Test set: org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc
---
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.468 s <<< 
FAILURE! - in 
org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc
testBasicInstallSnapshot(org.apache.ratis.server.simulation.TestRaftSnapshotWithSimulatedRpc)
  Time elapsed: 1.676 s  <<< FAILURE!
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at 
org.apache.ratis.statemachine.RaftSnapshotBaseTest.verifyTakeSnapshotMetric(RaftSnapshotBaseTest.java:261)
at 
org.apache.ratis.statemachine.RaftSnapshotBaseTest.testBasicInstallSnapshot(RaftSnapshotBaseTest.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:748)
{code}

For example without stack trace see RATIS-889.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-914) Failed UT: Can not mock final class

2020-04-30 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-914:


Thanks [~yjxxtd] for reporting this (and sorry for breaking it with the 
checkstyle change).  Do you plan to upgrade Mockito, or suppress the checkstyle 
warning for {{LogSegment}}, or do you have some other fix in mind?

> Failed UT:  Can not mock final class
> 
>
> Key: RATIS-914
> URL: https://issues.apache.org/jira/browse/RATIS-914
> Project: Ratis
>  Issue Type: Sub-task
>Reporter: runzhiwang
>Assignee: runzhiwang
>Priority: Major
> Attachments: screenshot-1.png
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
>  !screenshot-1.png! 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-913) Fix remaining (new) checkstyle violations

2020-04-29 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-913:
--

 Summary: Fix remaining (new) checkstyle violations
 Key: RATIS-913
 URL: https://issues.apache.org/jira/browse/RATIS-913
 Project: Ratis
  Issue Type: Sub-task
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai


There are a few remaining checkstyle violations (possibly introduced in new 
code since the fixes).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-757) Remove native library

2020-04-29 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-757:


Hi [~dineshchitlangia], are you already working on this issue, or may I take it?

> Remove native library
> -
>
> Key: RATIS-757
> URL: https://issues.apache.org/jira/browse/RATIS-757
> Project: Ratis
>  Issue Type: Improvement
>  Components: common
>Reporter: Dinesh Chitlangia
>Assignee: Dinesh Chitlangia
>Priority: Major
>
> [~szetszwo] recommended we remove the native library as it is no longer 
> useful after Java 7.
> https://issues.apache.org/jira/browse/RATIS-740?focusedCommentId=16976794=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16976794



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-828) Logs cluttered by AlreadyExistsException

2020-03-13 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-828:
--

 Summary: Logs cluttered by AlreadyExistsException
 Key: RATIS-828
 URL: https://issues.apache.org/jira/browse/RATIS-828
 Project: Ratis
  Issue Type: Wish
  Components: server
Reporter: Attila Doroszlai


Follow-up for HDDS-3148:

Ozone startup logs are cluttered by printing stack trace of 
AlreadyExistsException related to group addition.  Example:

{code}
2020-03-09 13:53:01,563 [grpc-default-executor-0] WARN  impl.RaftServerProxy 
(RaftServerProxy.java:lambda$groupAddAsync$11(390)) - 
7a07f161-9144-44b2-8baa-73f0e9299675: Failed groupAdd* 
GroupManagementRequest:client-27FB1A91809E->7a07f161-9144-44b2-8baa-73f0e9299675@group-E151028E3AC0,
 cid=2, seq=0, RW, null, 
Add:group-E151028E3AC0:[18f4e257-bf09-482e-b1bb-a2408a093ff7:172.17.0.2:43845, 
7a07f161-9144-44b2-8baa-73f0e9299675:172.17.0.2:41551, 
8a66c80e-ab55-4975-92a9-8aaf06ab418a:172.17.0.2:36921]
java.util.concurrent.CompletionException: 
org.apache.ratis.protocol.AlreadyExistsException: 
7a07f161-9144-44b2-8baa-73f0e9299675: Failed to add 
group-E151028E3AC0:[18f4e257-bf09-482e-b1bb-a2408a093ff7:172.17.0.2:43845, 
7a07f161-9144-44b2-8baa-73f0e9299675:172.17.0.2:41551, 
8a66c80e-ab55-4975-92a9-8aaf06ab418a:172.17.0.2:36921] since the group already 
exists in the map.
at 
java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at 
java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at 
java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:607)
at 
java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
at 
java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:631)
at 
java.util.concurrent.CompletableFuture.thenApplyAsync(CompletableFuture.java:2006)
at 
org.apache.ratis.server.impl.RaftServerProxy.groupAddAsync(RaftServerProxy.java:379)
at 
org.apache.ratis.server.impl.RaftServerProxy.groupManagementAsync(RaftServerProxy.java:363)
at 
org.apache.ratis.grpc.server.GrpcAdminProtocolService.lambda$groupManagement$0(GrpcAdminProtocolService.java:42)
at org.apache.ratis.grpc.GrpcUtil.asyncCall(GrpcUtil.java:160)
at 
org.apache.ratis.grpc.server.GrpcAdminProtocolService.groupManagement(GrpcAdminProtocolService.java:42)
at 
org.apache.ratis.proto.grpc.AdminProtocolServiceGrpc$MethodHandlers.invoke(AdminProtocolServiceGrpc.java:358)
at 
org.apache.ratis.thirdparty.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
at 
org.apache.ratis.thirdparty.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814)
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:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ratis.protocol.AlreadyExistsException: 
7a07f161-9144-44b2-8baa-73f0e9299675: Failed to add 
group-E151028E3AC0:[18f4e257-bf09-482e-b1bb-a2408a093ff7:172.17.0.2:43845, 
7a07f161-9144-44b2-8baa-73f0e9299675:172.17.0.2:41551, 
8a66c80e-ab55-4975-92a9-8aaf06ab418a:172.17.0.2:36921] since the group already 
exists in the map.
at 
org.apache.ratis.server.impl.RaftServerProxy$ImplMap.addNew(RaftServerProxy.java:83)
at 
org.apache.ratis.server.impl.RaftServerProxy.groupAddAsync(RaftServerProxy.java:378)
... 13 more
{code}

Since these are "normal", I think stack trace should be suppressed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-815) Log entry corrupted with 0 checksum

2020-02-20 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-815:


Thanks [~szetszwo] for the patch.  Tested it with the steps I reported, and it 
worked fine, all 32 keys were created successfully.

> Log entry corrupted with 0 checksum
> ---
>
> Key: RATIS-815
> URL: https://issues.apache.org/jira/browse/RATIS-815
> Project: Ratis
>  Issue Type: Bug
>Affects Versions: 0.5.0
>Reporter: Attila Doroszlai
>Assignee: Tsz-wo Sze
>Priority: Blocker
> Attachments: RATIS-815.temp.patch, dumps.tar.gz, logs.tar.gz, 
> r815_20200220.patch
>
>
> After writing a few large keys (128MB) with very small chunks size (64KB) in 
> Ozone, Ratis reports log entry corruption due to checksum error:
> {code}
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:396 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  Rolling segment log-62379_62465 to index:62465
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:541 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  Rolled log segment from 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62379
>  to 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_62379-62465
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:583 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  created new log segment 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62466
> 2020-02-13 12:01:41 ERROR LogAppender:81 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236->ac5b3434-874b-4375-8a03-989e8c7fb692-GrpcLogAppender-AppenderDaemon
>  failed RaftLog
> org.apache.ratis.server.raftlog.RaftLogIOException: 
> org.apache.ratis.protocol.ChecksumException: Log entry corrupted: Calculated 
> checksum is CDFED097 but read checksum is .
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:311)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.get(SegmentedRaftLog.java:292)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:297)
>   at 
> org.apache.ratis.server.impl.LogAppender.createRequest(LogAppender.java:213)
>   at 
> org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:179)
>   at 
> org.apache.ratis.grpc.server.GrpcLogAppender.runAppenderImpl(GrpcLogAppender.java:122)
>   at 
> org.apache.ratis.server.impl.LogAppender$AppenderDaemon.run(LogAppender.java:77)
>   at java.lang.Thread.run(Thread.java:748)
> Caused by: org.apache.ratis.protocol.ChecksumException: Log entry corrupted: 
> Calculated checksum is CDFED097 but read checksum is .
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.decodeEntry(SegmentedRaftLogReader.java:312)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.readEntry(SegmentedRaftLogReader.java:194)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogInputStream.nextEntry(SegmentedRaftLogInputStream.java:129)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.readSegmentFile(LogSegment.java:98)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment$LogEntryLoader.load(LogSegment.java:202)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:309)
>   ... 7 more
> {code}
> Steps to reproduce:
> 1. Configure Ozone with 64KB chunk size and slightly higher buffer sizes:
> {code}
> ozone.scm.chunk.size: 64KB
> ozone.client.stream.buffer.flush.size: 256KB
> ozone.client.stream.buffer.max.size: 1MB
> {code}
> 2. Run Freon:
> {code}
> ozone freon ockg -n 1 -t 1 -p warmup
> ozone freon ockg -p test -t 8 -s 134217728 -n 32
> {code}
> Interestingly, even {{log_5106-5509}} has invalid entry (according to log 
> dump utility):
> {code}
> Processing Raft Log file: 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_5106-5509
>  size:1030796
> ...
> (t:1, i:5161), STATEMACHINELOGENTRY, client-296B6A48E40D, cid=3307
> Exception in thread "main" org.apache.ratis.protocol.ChecksumException: Log 
> entry corrupted: Calculated checksum is 926127AE but read checksum is 
> .
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-818) New releases not listed in website

2020-02-20 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-818:
--

 Summary: New releases not listed in website
 Key: RATIS-818
 URL: https://issues.apache.org/jira/browse/RATIS-818
 Project: Ratis
  Issue Type: Bug
  Components: website
Reporter: Attila Doroszlai


[https://ratis.incubator.apache.org/#download] only lists releases up to 0.3.0. 
 Both 0.4.0 and 0.5.0 are missing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-815) Log entry corrupted with 0 checksum

2020-02-17 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-815:


Tested with RATIS-767 reverted: same problem happens.

> Log entry corrupted with 0 checksum
> ---
>
> Key: RATIS-815
> URL: https://issues.apache.org/jira/browse/RATIS-815
> Project: Ratis
>  Issue Type: Bug
>Affects Versions: 0.5.0
>Reporter: Attila Doroszlai
>Priority: Blocker
> Attachments: dumps.tar.gz, logs.tar.gz
>
>
> After writing a few large keys (128MB) with very small chunks size (64KB) in 
> Ozone, Ratis reports log entry corruption due to checksum error:
> {code}
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:396 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  Rolling segment log-62379_62465 to index:62465
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:541 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  Rolled log segment from 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62379
>  to 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_62379-62465
> 2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:583 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker:
>  created new log segment 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62466
> 2020-02-13 12:01:41 ERROR LogAppender:81 - 
> e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236->ac5b3434-874b-4375-8a03-989e8c7fb692-GrpcLogAppender-AppenderDaemon
>  failed RaftLog
> org.apache.ratis.server.raftlog.RaftLogIOException: 
> org.apache.ratis.protocol.ChecksumException: Log entry corrupted: Calculated 
> checksum is CDFED097 but read checksum is .
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:311)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.get(SegmentedRaftLog.java:292)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:297)
>   at 
> org.apache.ratis.server.impl.LogAppender.createRequest(LogAppender.java:213)
>   at 
> org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:179)
>   at 
> org.apache.ratis.grpc.server.GrpcLogAppender.runAppenderImpl(GrpcLogAppender.java:122)
>   at 
> org.apache.ratis.server.impl.LogAppender$AppenderDaemon.run(LogAppender.java:77)
>   at java.lang.Thread.run(Thread.java:748)
> Caused by: org.apache.ratis.protocol.ChecksumException: Log entry corrupted: 
> Calculated checksum is CDFED097 but read checksum is .
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.decodeEntry(SegmentedRaftLogReader.java:312)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.readEntry(SegmentedRaftLogReader.java:194)
>   at 
> org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogInputStream.nextEntry(SegmentedRaftLogInputStream.java:129)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.readSegmentFile(LogSegment.java:98)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment$LogEntryLoader.load(LogSegment.java:202)
>   at 
> org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:309)
>   ... 7 more
> {code}
> Steps to reproduce:
> 1. Configure Ozone with 64KB chunk size and slightly higher buffer sizes:
> {code}
> ozone.scm.chunk.size: 64KB
> ozone.client.stream.buffer.flush.size: 256KB
> ozone.client.stream.buffer.max.size: 1MB
> {code}
> 2. Run Freon:
> {code}
> ozone freon ockg -n 1 -t 1 -p warmup
> ozone freon ockg -p test -t 8 -s 134217728 -n 32
> {code}
> Interestingly, even {{log_5106-5509}} has invalid entry (according to log 
> dump utility):
> {code}
> Processing Raft Log file: 
> /data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_5106-5509
>  size:1030796
> ...
> (t:1, i:5161), STATEMACHINELOGENTRY, client-296B6A48E40D, cid=3307
> Exception in thread "main" org.apache.ratis.protocol.ChecksumException: Log 
> entry corrupted: Calculated checksum is 926127AE but read checksum is 
> .
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-815) Log entry corrupted with 0 checksum

2020-02-13 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-815:
---
Description: 
After writing a few large keys (128MB) with very small chunks size (64KB) in 
Ozone, Ratis reports log entry corruption due to checksum error:

{code}
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:396 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolling segment log-62379_62465 to index:62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:541 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolled log segment from 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62379
 to 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_62379-62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:583 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
created new log segment 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62466
2020-02-13 12:01:41 ERROR LogAppender:81 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236->ac5b3434-874b-4375-8a03-989e8c7fb692-GrpcLogAppender-AppenderDaemon
 failed RaftLog
org.apache.ratis.server.raftlog.RaftLogIOException: 
org.apache.ratis.protocol.ChecksumException: Log entry corrupted: Calculated 
checksum is CDFED097 but read checksum is .
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:311)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.get(SegmentedRaftLog.java:292)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:297)
at 
org.apache.ratis.server.impl.LogAppender.createRequest(LogAppender.java:213)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:179)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.runAppenderImpl(GrpcLogAppender.java:122)
at 
org.apache.ratis.server.impl.LogAppender$AppenderDaemon.run(LogAppender.java:77)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ratis.protocol.ChecksumException: Log entry corrupted: 
Calculated checksum is CDFED097 but read checksum is .
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.decodeEntry(SegmentedRaftLogReader.java:312)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.readEntry(SegmentedRaftLogReader.java:194)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogInputStream.nextEntry(SegmentedRaftLogInputStream.java:129)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.readSegmentFile(LogSegment.java:98)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment$LogEntryLoader.load(LogSegment.java:202)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:309)
... 7 more
{code}

Steps to reproduce:

1. Configure Ozone with 64KB chunk size and slightly higher buffer sizes:
{code}
ozone.scm.chunk.size: 64KB
ozone.client.stream.buffer.flush.size: 256KB
ozone.client.stream.buffer.max.size: 1MB
{code}
2. Run Freon:
{code}
ozone freon ockg -n 1 -t 1 -p warmup
ozone freon ockg -p test -t 8 -s 134217728 -n 32
{code}

Interestingly, even {{log_5106-5509}} has invalid entry (according to log dump 
utility):

{code}
Processing Raft Log file: 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_5106-5509 
size:1030796
...
(t:1, i:5161), STATEMACHINELOGENTRY, client-296B6A48E40D, cid=3307
Exception in thread "main" org.apache.ratis.protocol.ChecksumException: Log 
entry corrupted: Calculated checksum is 926127AE but read checksum is .
{code}

  was:
After writing a few large keys (128MB) with very small chunks size (64KB) in 
Ozone, Ratis reports log entry corruption due to checksum error:

{code}
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:396 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolling segment log-62379_62465 to index:62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:541 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolled log segment from 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62379
 to 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_62379-62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:583 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
created new log segment 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62466
2020-02-13 12:01:41 ERROR LogAppender:81 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236->ac5b3434-874b-4375-8a03-989e8c7fb692-GrpcLogAppender-AppenderDaemon
 failed RaftLog

[jira] [Created] (RATIS-815) Log entry corrupted with 0 checksum

2020-02-13 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-815:
--

 Summary: Log entry corrupted with 0 checksum
 Key: RATIS-815
 URL: https://issues.apache.org/jira/browse/RATIS-815
 Project: Ratis
  Issue Type: Bug
Affects Versions: 0.5.0
Reporter: Attila Doroszlai


After writing a few large keys (128MB) with very small chunks size (64KB) in 
Ozone, Ratis reports log entry corruption due to checksum error:

{code}
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:396 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolling segment log-62379_62465 to index:62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:541 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
Rolled log segment from 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62379
 to 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_62379-62465
2020-02-13 12:01:41 INFO  SegmentedRaftLogWorker:583 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236-SegmentedRaftLogWorker: 
created new log segment 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_inprogress_62466
2020-02-13 12:01:41 ERROR LogAppender:81 - 
e5e4fd1e-aa81-48a2-98f9-b1ba24531624@group-B85226EEE236->ac5b3434-874b-4375-8a03-989e8c7fb692-GrpcLogAppender-AppenderDaemon
 failed RaftLog
org.apache.ratis.server.raftlog.RaftLogIOException: 
org.apache.ratis.protocol.ChecksumException: Log entry corrupted: Calculated 
checksum is CDFED097 but read checksum is .
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:311)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.get(SegmentedRaftLog.java:292)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:297)
at 
org.apache.ratis.server.impl.LogAppender.createRequest(LogAppender.java:213)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:179)
at 
org.apache.ratis.grpc.server.GrpcLogAppender.runAppenderImpl(GrpcLogAppender.java:122)
at 
org.apache.ratis.server.impl.LogAppender$AppenderDaemon.run(LogAppender.java:77)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ratis.protocol.ChecksumException: Log entry corrupted: 
Calculated checksum is CDFED097 but read checksum is .
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.decodeEntry(SegmentedRaftLogReader.java:312)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader.readEntry(SegmentedRaftLogReader.java:194)
at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogInputStream.nextEntry(SegmentedRaftLogInputStream.java:129)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.readSegmentFile(LogSegment.java:98)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment$LogEntryLoader.load(LogSegment.java:202)
at 
org.apache.ratis.server.raftlog.segmented.LogSegment.loadCache(LogSegment.java:309)
... 7 more
{code}

Steps to reproduce:

1. Configure Ozone with 64KB chunk size and slightly higher buffer sizes:
{code}
ozone.scm.chunk.size: 64KB
ozone.client.stream.buffer.flush.size: 256KB
ozone.client.stream.buffer.max.size: 1MB
{code}
2. Run Freon:
{code}
ozone freon ockg -n 1 -t 1 -p warmup
ozone freon ockg -p test -t 8 -s 134217728 -n 32
{code}

Interestingly, even {{log_5106-5509}} has invalid entry (according to log dump 
utility):

{code}
Processing Raft Log file: 
/data/metadata/ratis/f89fc072-9ee9-459b-85d1-b85226eee236/current/log_5106-5509 
size:1030796
...
(t:1, i:5161), STATEMACHINELOGENTRY, client-296B6A48E40D, cid=3307
Exception in thread "main" org.apache.ratis.protocol.ChecksumException: Log 
entry corrupted: Calculated checksum is 926127AE but read checksum is .
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-789) ConcurrentModification in MetricsRegistriesImpl

2020-01-28 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-789:


Thanks [~avijayan] the review and [~msingh] for committing it.

> ConcurrentModification in MetricsRegistriesImpl
> ---
>
> Key: RATIS-789
> URL: https://issues.apache.org/jira/browse/RATIS-789
> Project: Ratis
>  Issue Type: Bug
>  Components: metrics
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Major
> Fix For: 0.5.0
>
> Attachments: RATIS-789.001.patch
>
>
> {code}
> java.util.ConcurrentModificationException
>   at java.util.ArrayList.forEach(ArrayList.java:1260)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
>   at 
> java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
>   at 
> org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
>   at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
>   at 
> org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
>   at 
> org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
>   at 
> org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
> {code}
> (RATIS-788 has more details, if needed)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-788) Server stuck due to exception while becoming leader

2020-01-16 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-788:
---
Description: 
It seems if any exception happens while becoming leader, a single-node Ratis 
group can get stuck: {{in LEADER state but not ready yet}}.  Or is there some 
timeout that lets Ratis get out of this state?  I guess 3-node Ratis might be 
able to recover.

{{LeaderElection}} ignores the exception because it is already shut down after 
successful vote.

The {{ConcurrentModificationException}} which triggered it in this specific 
case is being fixed in RATIS-789.

{code}
2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RaftServerImpl 
(RaftServerImpl.java:setRole(173)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from  
FOLLOWER to CANDIDATE at term 0 for changeToCandidate
2020-01-09 23:31:35,165 [Thread-95] INFO  impl.RoleInfo 
(RoleInfo.java:updateAndGet(143)) - 6b60526e-eae6-4f33-854d-fa396187085c: start 
LeaderElection
2020-01-09 23:31:35,176 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.LeaderElection (LeaderElection.java:askForVotes(206)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: begin 
an election at term 1 for -1: 
[6b60526e-eae6-4f33-854d-fa396187085c:localhost:9872], old=null
2020-01-09 23:31:35,177 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RoleInfo (RoleInfo.java:shutdownLeaderElection(134)) - 
6b60526e-eae6-4f33-854d-fa396187085c: shutdown LeaderElection
2020-01-09 23:31:35,178 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RaftServerImpl (RaftServerImpl.java:setRole(173)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from 
CANDIDATE to LEADER at term 1 for changeToLeader
2020-01-09 23:31:35,178 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RaftServerImpl (ServerState.java:setLeader(255)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: change Leader from 
null to 6b60526e-eae6-4f33-854d-fa396187085c at term 1 for becomeLeader, leader 
elected after 1269ms
...
2020-01-09 23:31:35,217 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.LeaderElection (LeaderElection.java:run(165)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: 
ConcurrentModificationException is safely ignored since this is already CLOSING
java.util.ConcurrentModificationException
at java.util.ArrayList.forEach(ArrayList.java:1260)
at 
org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
at 
org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
at 
java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
at 
org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
at 
org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
at 
org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
at 
org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
at 
org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
at 
org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
at 
org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
at 
org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
at 
org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
at java.lang.Thread.run(Thread.java:748)
...
2020-01-09 23:31:48,567 ... 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E is in LEADER state but 
not ready yet.
{code}

  was:
It seems single-node Ratis can get stuck if exception happens while becoming 
leader.  {{LeaderElection}} ignores the exception because it is already shut 
down after successful vote.  I guess 3-node Ratis might be able to recover.

{code}
2020-01-09 23:31:35,160 [Thread-95] INFO  impl.FollowerState 
(FollowerState.java:run(108)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-FollowerState: change 
to CANDIDATE, lastRpcTime:1117ms, electionTimeout:1103ms
2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RoleInfo 
(RoleInfo.java:shutdownFollowerState(121)) - 
6b60526e-eae6-4f33-854d-fa396187085c: shutdown FollowerState
2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RaftServerImpl 
(RaftServerImpl.java:setRole(173)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from  
FOLLOWER to CANDIDATE at term 0 for changeToCandidate
2020-01-09 23:31:35,165 [Thread-95] INFO  

[jira] [Commented] (RATIS-789) ConcurrentModification in MetricsRegistriesImpl

2020-01-16 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-789:


Hi [~elek], can you please review?

> ConcurrentModification in MetricsRegistriesImpl
> ---
>
> Key: RATIS-789
> URL: https://issues.apache.org/jira/browse/RATIS-789
> Project: Ratis
>  Issue Type: Bug
>  Components: metrics
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Major
> Attachments: RATIS-789.001.patch
>
>
> {code}
> java.util.ConcurrentModificationException
>   at java.util.ArrayList.forEach(ArrayList.java:1260)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
>   at 
> java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
>   at 
> org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
>   at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
>   at 
> org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
>   at 
> org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
>   at 
> org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
> {code}
> (RATIS-788 has more details, if needed)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-789) ConcurrentModification in MetricsRegistriesImpl

2020-01-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-789:
---
Attachment: RATIS-789.001.patch

> ConcurrentModification in MetricsRegistriesImpl
> ---
>
> Key: RATIS-789
> URL: https://issues.apache.org/jira/browse/RATIS-789
> Project: Ratis
>  Issue Type: Bug
>  Components: metrics
>Reporter: Attila Doroszlai
>Priority: Major
> Attachments: RATIS-789.001.patch
>
>
> {code}
> java.util.ConcurrentModificationException
>   at java.util.ArrayList.forEach(ArrayList.java:1260)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
>   at 
> java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
>   at 
> org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
>   at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
>   at 
> org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
>   at 
> org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
>   at 
> org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
> {code}
> (RATIS-788 has more details, if needed)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (RATIS-789) ConcurrentModification in MetricsRegistriesImpl

2020-01-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai reassigned RATIS-789:
--

Assignee: Attila Doroszlai

> ConcurrentModification in MetricsRegistriesImpl
> ---
>
> Key: RATIS-789
> URL: https://issues.apache.org/jira/browse/RATIS-789
> Project: Ratis
>  Issue Type: Bug
>  Components: metrics
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Major
> Attachments: RATIS-789.001.patch
>
>
> {code}
> java.util.ConcurrentModificationException
>   at java.util.ArrayList.forEach(ArrayList.java:1260)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
>   at 
> java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
>   at 
> org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
>   at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
>   at 
> org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
>   at 
> org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
>   at 
> org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
> {code}
> (RATIS-788 has more details, if needed)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-788) Server stuck due to exception while becoming leader

2020-01-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-788:
---
Attachment: 
org.apache.hadoop.ozone.scm.TestSCMContainerPlacementPolicyMetrics.txt

org.apache.hadoop.ozone.scm.TestSCMContainerPlacementPolicyMetrics-output.txt

> Server stuck due to exception while becoming leader
> ---
>
> Key: RATIS-788
> URL: https://issues.apache.org/jira/browse/RATIS-788
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Major
> Attachments: 
> org.apache.hadoop.ozone.scm.TestSCMContainerPlacementPolicyMetrics-output.txt,
>  org.apache.hadoop.ozone.scm.TestSCMContainerPlacementPolicyMetrics.txt
>
>
> It seems single-node Ratis can get stuck if exception happens while becoming 
> leader.  {{LeaderElection}} ignores the exception because it is already shut 
> down after successful vote.  I guess 3-node Ratis might be able to recover.
> {code}
> 2020-01-09 23:31:35,160 [Thread-95] INFO  impl.FollowerState 
> (FollowerState.java:run(108)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-FollowerState: change 
> to CANDIDATE, lastRpcTime:1117ms, electionTimeout:1103ms
> 2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RoleInfo 
> (RoleInfo.java:shutdownFollowerState(121)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c: shutdown FollowerState
> 2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RaftServerImpl 
> (RaftServerImpl.java:setRole(173)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from  
> FOLLOWER to CANDIDATE at term 0 for changeToCandidate
> 2020-01-09 23:31:35,165 [Thread-95] INFO  impl.RoleInfo 
> (RoleInfo.java:updateAndGet(143)) - 6b60526e-eae6-4f33-854d-fa396187085c: 
> start LeaderElection
> 2020-01-09 23:31:35,176 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  impl.LeaderElection (LeaderElection.java:askForVotes(206)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: 
> begin an election at term 1 for -1: 
> [6b60526e-eae6-4f33-854d-fa396187085c:localhost:9872], old=null
> 2020-01-09 23:31:35,177 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  impl.RoleInfo (RoleInfo.java:shutdownLeaderElection(134)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c: shutdown LeaderElection
> 2020-01-09 23:31:35,178 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  impl.RaftServerImpl (RaftServerImpl.java:setRole(173)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from 
> CANDIDATE to LEADER at term 1 for changeToLeader
> 2020-01-09 23:31:35,178 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  impl.RaftServerImpl (ServerState.java:setLeader(255)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: change Leader from 
> null to 6b60526e-eae6-4f33-854d-fa396187085c at term 1 for becomeLeader, 
> leader elected after 1269ms
> 2020-01-09 23:31:35,183 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  server.RaftServerConfigKeys (ConfUtils.java:logGet(43)) - 
> raft.server.staging.catchup.gap = 1000 (default)
> 2020-01-09 23:31:35,185 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  server.RaftServerConfigKeys (ConfUtils.java:logGet(43)) - 
> raft.server.rpc.sleep.time = 25ms (default)
> 2020-01-09 23:31:35,217 
> [6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] 
> INFO  impl.LeaderElection (LeaderElection.java:run(165)) - 
> 6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: 
> ConcurrentModificationException is safely ignored since this is already 
> CLOSING
> java.util.ConcurrentModificationException
>   at java.util.ArrayList.forEach(ArrayList.java:1260)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
>   at 
> java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
>   at 
> org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
>   at 
> org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
>   at 
> org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
>   at 
> org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
>   at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
>   at 
> 

[jira] [Created] (RATIS-788) Server stuck due to exception while becoming leader

2020-01-10 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-788:
--

 Summary: Server stuck due to exception while becoming leader
 Key: RATIS-788
 URL: https://issues.apache.org/jira/browse/RATIS-788
 Project: Ratis
  Issue Type: Bug
  Components: server
Reporter: Attila Doroszlai


It seems single-node Ratis can get stuck if exception happens while becoming 
leader.  {{LeaderElection}} ignores the exception because it is already shut 
down after successful vote.  I guess 3-node Ratis might be able to recover.

{code}
2020-01-09 23:31:35,160 [Thread-95] INFO  impl.FollowerState 
(FollowerState.java:run(108)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-FollowerState: change 
to CANDIDATE, lastRpcTime:1117ms, electionTimeout:1103ms
2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RoleInfo 
(RoleInfo.java:shutdownFollowerState(121)) - 
6b60526e-eae6-4f33-854d-fa396187085c: shutdown FollowerState
2020-01-09 23:31:35,161 [Thread-95] INFO  impl.RaftServerImpl 
(RaftServerImpl.java:setRole(173)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from  
FOLLOWER to CANDIDATE at term 0 for changeToCandidate
2020-01-09 23:31:35,165 [Thread-95] INFO  impl.RoleInfo 
(RoleInfo.java:updateAndGet(143)) - 6b60526e-eae6-4f33-854d-fa396187085c: start 
LeaderElection
2020-01-09 23:31:35,176 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.LeaderElection (LeaderElection.java:askForVotes(206)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: begin 
an election at term 1 for -1: 
[6b60526e-eae6-4f33-854d-fa396187085c:localhost:9872], old=null
2020-01-09 23:31:35,177 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RoleInfo (RoleInfo.java:shutdownLeaderElection(134)) - 
6b60526e-eae6-4f33-854d-fa396187085c: shutdown LeaderElection
2020-01-09 23:31:35,178 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RaftServerImpl (RaftServerImpl.java:setRole(173)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: changes role from 
CANDIDATE to LEADER at term 1 for changeToLeader
2020-01-09 23:31:35,178 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.RaftServerImpl (ServerState.java:setLeader(255)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E: change Leader from 
null to 6b60526e-eae6-4f33-854d-fa396187085c at term 1 for becomeLeader, leader 
elected after 1269ms
2020-01-09 23:31:35,183 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
server.RaftServerConfigKeys (ConfUtils.java:logGet(43)) - 
raft.server.staging.catchup.gap = 1000 (default)
2020-01-09 23:31:35,185 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
server.RaftServerConfigKeys (ConfUtils.java:logGet(43)) - 
raft.server.rpc.sleep.time = 25ms (default)
2020-01-09 23:31:35,217 
[6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1] INFO  
impl.LeaderElection (LeaderElection.java:run(165)) - 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E-LeaderElection1: 
ConcurrentModificationException is safely ignored since this is already CLOSING
java.util.ConcurrentModificationException
at java.util.ArrayList.forEach(ArrayList.java:1260)
at 
org.apache.ratis.metrics.impl.MetricRegistriesImpl.lambda$create$1(MetricRegistriesImpl.java:66)
at 
org.apache.ratis.metrics.impl.RefCountingMap.lambda$put$0(RefCountingMap.java:51)
at 
java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
at 
org.apache.ratis.metrics.impl.RefCountingMap.put(RefCountingMap.java:46)
at 
org.apache.ratis.metrics.impl.MetricRegistriesImpl.create(MetricRegistriesImpl.java:59)
at 
org.apache.ratis.server.metrics.RatisMetrics.create(RatisMetrics.java:45)
at 
org.apache.ratis.server.metrics.RatisMetrics.getMetricRegistryForLogAppender(RatisMetrics.java:82)
at 
org.apache.ratis.server.metrics.LogAppenderMetrics.(LogAppenderMetrics.java:32)
at org.apache.ratis.server.impl.LeaderState.(LeaderState.java:221)
at 
org.apache.ratis.server.impl.RoleInfo.startLeaderState(RoleInfo.java:94)
at 
org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:348)
at 
org.apache.ratis.server.impl.LeaderElection.askForVotes(LeaderElection.java:238)
at 
org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:161)
at java.lang.Thread.run(Thread.java:748)
...
2020-01-09 23:31:48,567 ... 
6b60526e-eae6-4f33-854d-fa396187085c@group-C5BA1605619E is in LEADER state but 
not ready yet.
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-768) LogUtils#infoOrTrace prints exception trace at both levels

2019-12-05 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-768:


Thanks [~szetszwo] for committing it.

> LogUtils#infoOrTrace prints exception trace at both levels
> --
>
> Key: RATIS-768
> URL: https://issues.apache.org/jira/browse/RATIS-768
> Project: Ratis
>  Issue Type: Bug
>  Components: common
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Trivial
> Fix For: 0.5.0
>
> Attachments: RATIS-768.001.patch
>
>
> With logging set to
>  * trace level, log contains "message" and the stack trace
>  * info level, log will have "message: {}" and the stack trace
> I think the intention was to only log the exception message instead of the 
> stack trace at info level.  Otherwise there is no difference between the 
> levels other than the stray placeholder.
> {code}
>   static void infoOrTrace(Logger log, Supplier message, Throwable t) {
> if (log.isTraceEnabled()) {
>   log.trace(message.get(), t);
> } else {
>   log.info("{}: {}", message.get(), t);
> }
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-771) Rat check failure due to a unwanted tmp file

2019-12-05 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-771:


Thanks [~szetszwo] for committing it.

> Rat check failure due to a unwanted tmp file
> 
>
> Key: RATIS-771
> URL: https://issues.apache.org/jira/browse/RATIS-771
> Project: Ratis
>  Issue Type: Bug
>  Components: build
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Trivial
> Fix For: 0.5.0
>
> Attachments: RATIS-771.001.patch
>
>
> {code}
> Lines that start with ? in the ASF License  report indicate files that do 
> not have an Apache license header:
>  !? 
> /testptch/ratis/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/tmp
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-771) Rat check failure

2019-12-05 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-771:
---
Attachment: RATIS-771.001.patch

> Rat check failure
> -
>
> Key: RATIS-771
> URL: https://issues.apache.org/jira/browse/RATIS-771
> Project: Ratis
>  Issue Type: Bug
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Trivial
> Attachments: RATIS-771.001.patch
>
>
> {code}
> Lines that start with ? in the ASF License  report indicate files that do 
> not have an Apache license header:
>  !? 
> /testptch/ratis/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/tmp
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-771) Rat check failure

2019-12-05 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-771:
--

 Summary: Rat check failure
 Key: RATIS-771
 URL: https://issues.apache.org/jira/browse/RATIS-771
 Project: Ratis
  Issue Type: Bug
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai


{code}
Lines that start with ? in the ASF License  report indicate files that do 
not have an Apache license header:
 !? 
/testptch/ratis/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/tmp
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-768) LogUtils#infoOrTrace prints exception trace at both levels

2019-12-05 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-768:
---
Attachment: RATIS-768.001.patch

> LogUtils#infoOrTrace prints exception trace at both levels
> --
>
> Key: RATIS-768
> URL: https://issues.apache.org/jira/browse/RATIS-768
> Project: Ratis
>  Issue Type: Bug
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Trivial
> Attachments: RATIS-768.001.patch
>
>
> With logging set to
>  * trace level, log contains "message" and the stack trace
>  * info level, log will have "message: {}" and the stack trace
> I think the intention was to only log the exception message instead of the 
> stack trace at info level.  Otherwise there is no difference between the 
> levels other than the stray placeholder.
> {code}
>   static void infoOrTrace(Logger log, Supplier message, Throwable t) {
> if (log.isTraceEnabled()) {
>   log.trace(message.get(), t);
> } else {
>   log.info("{}: {}", message.get(), t);
> }
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-768) LogUtils#infoOrTrace prints exception trace at both levels

2019-12-05 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-768:
--

 Summary: LogUtils#infoOrTrace prints exception trace at both levels
 Key: RATIS-768
 URL: https://issues.apache.org/jira/browse/RATIS-768
 Project: Ratis
  Issue Type: Bug
Reporter: Attila Doroszlai
Assignee: Attila Doroszlai


With logging set to

 * trace level, log contains "message" and the stack trace
 * info level, log will have "message: {}" and the stack trace

I think the intention was to only log the exception message instead of the 
stack trace at info level.  Otherwise there is no difference between the levels 
other than the stray placeholder.

{code}
  static void infoOrTrace(Logger log, Supplier message, Throwable t) {
if (log.isTraceEnabled()) {
  log.trace(message.get(), t);
} else {
  log.info("{}: {}", message.get(), t);
}
  }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-21 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-758:


[~szetszwo], the PR has 3 commits:

# 
[repro/test|https://github.com/apache/incubator-ratis/pull/48/commits/0a49cd065d4d8b7c7d50320e1878af57ba4f2e3c]
# [initial 
fix|https://github.com/apache/incubator-ratis/pull/48/commits/304f3f8b885f47f3e2c80a70dfeead5c97f44639]
 (for {{RUNNING -> CLOSED}})
# [additional 
fix|https://github.com/apache/incubator-ratis/pull/48/commits/9f5c8b78f8f91c0ec53ffe0261660d124cbbb81e]
 (for {{CLOSING/CLOSED -> STARTING/RUNNING}} illegal transitions)

The first commit inadvertently increased the chance of {{CLOSING/CLOSED -> 
RUNNING}} transitions (by moving the transition to {{run()}}).  But it is not 
new, RATIS-578 also has an example of this.  I think LeaderElection may be 
{{shutdown()}} before {{start()}} is called in the following sequence:

# thread 1: {{startLeaderElection}} creates {{LeaderElection}} and "publishes" 
it (via {{updateAndGet}})
# thread 2: {{shutdownLeaderElection}} finds new {{LeaderElection}} and calls 
{{shutdown}}
# thread 1: calls {{start}} on the {{leaderElection}} returned from (via 
{{updateAndGet}})

This sequence is simulated in {{testShutdownBeforeStart}} without threads.

The proposed fix for this is to avoid unconditional transitions to STARTING and 
RUNNING.

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Critical
>  Labels: ozone
> Attachments: RATIS-758.001.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-21 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-758:
---
Attachment: RATIS-758.001.patch

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Critical
>  Labels: ozone
> Attachments: RATIS-758.001.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-20 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai edited comment on RATIS-758 at 11/20/19 12:47 PM:
---

It seems this can happen if {{LeaderElection#askForVotes}} returns without 
executing any iterations due to immediately changing to follower.  This leaves 
{{LeaderElection}} in {{RUNNING}} state after {{askForVotes}}, and results in 
the illegal transition in {{finally}}.


was (Author: adoroszlai):
It seems this can happen if {{LeaderElection#askForVotes}} returns without 
executing any iterations due to immediately changing to follower.  This leaves 
{{LeaderElection}} in {{RUNNING}} state.

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Critical
>  Labels: ozone
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-20 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-758:
---
Priority: Critical  (was: Major)

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Critical
>  Labels: ozone
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Assigned] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-20 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai reassigned RATIS-758:
--

Assignee: Attila Doroszlai

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Major
>  Labels: ozone
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-20 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-758:


It seems this can happen if {{LeaderElection#askForVotes}} returns without 
executing any iterations due to immediately changing to follower.  This leaves 
{{LeaderElection}} in {{RUNNING}} state.

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Major
>  Labels: ozone
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-578) Illegal State transition in LeaderElection

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-578:


Observed the RUNNING -> CLOSED transition in Ozone tests, filed RATIS-758 for 
it.

> Illegal State transition in LeaderElection
> --
>
> Key: RATIS-578
> URL: https://issues.apache.org/jira/browse/RATIS-578
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Affects Versions: 0.3.0
>Reporter: Mukul Kumar Singh
>Assignee: Tsz-wo Sze
>Priority: Major
>  Labels: ozone
> Fix For: 0.4.0
>
> Attachments: r578_20190731.patch
>
>
> Illegal State transition in LeaderElection
> {code}
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 3d75e29e-ff2a-47a6-82c4-6408d200876d:2019group--CB73AD2587F6:LeaderElection13,
>  STARTING -> CLOSED
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 3d75e29e-ff2a-47a6-82c4-6408d200876d:group-CB73AD2587F6:LeaderElection13, 
> CLOSED -> RUNNING
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 37da83b0-33ff-44cf-aeb9-67a102e13468:group-9FC4313E1696:LeaderElection217, 
> RUNNING -> CLOSED
> java.lang.IllegalStateException: IL2LEGAL TRANSITION: I0n 
> 95ef0599-6d8a-40f8-a69c-7ba0c956dc6c:group-21734B88A322:LeaderElection265, 
> RUNNING -> CLOSED
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-758) Illegal state transition in LeaderElection: RUNNING to CLOSED

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-758:
---
Labels: ozone  (was: )

> Illegal state transition in LeaderElection: RUNNING to CLOSED
> -
>
> Key: RATIS-758
> URL: https://issues.apache.org/jira/browse/RATIS-758
> Project: Ratis
>  Issue Type: Bug
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Major
>  Labels: ozone
>
> Observed the following illegal state transition (using Ratis 
> 0.5.0-d6d58d0-SNAPSHOT):
> {code}
> 2019-11-19 22:57:04,604 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: start LeaderElection
> 2019-11-19 22:57:04,605 INFO impl.RaftServerImpl: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A: changes role from 
> CANDIDATE to FOLLOWER at term 3 for 
> recognizeCandidate:ed65d927-a26b-4755-87c9-8340ec30b69f
> 2019-11-19 22:57:04,612 INFO impl.RoleInfo: 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0: shutdown LeaderElection
> Exception in thread 
> "0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4" 
> java.lang.IllegalStateException: ILLEGAL TRANSITION: In 
> 0b15f105-b523-4d80-ad5c-5dd005e74db0@group-3FF25090045A-LeaderElection4, 
> RUNNING -> CLOSED
>   at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:63)
>   at org.apache.ratis.util.LifeCycle$State.validate(LifeCycle.java:123)
>   at org.apache.ratis.util.LifeCycle.transition(LifeCycle.java:143)
>   at 
> org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:151)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-749) Create constant for set of not running states

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-749:


Thanks [~szetszwo] for committing it.

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Assignee: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Fix For: 0.5.0
>
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> RATIS-749.002.patch, RATIS-749.002b.patch, allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-749) Create constant for set of not running states

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-749:


[~szetszwo], thanks for checking these patches.  I have updated both based on 
your comments.

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> RATIS-749.002.patch, RATIS-749.002b.patch, allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-749) Create constant for set of not running states

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-749:
---
Attachment: RATIS-749.002b.patch
RATIS-749.002.patch

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> RATIS-749.002.patch, RATIS-749.002b.patch, allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-749) Create constant for set of not running states

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-749:


bq. If we change isOneOf with a Set parameter, the method becomes redundant. 
Why not calling states.contains directly?

Agree, but wanted to avoid too much change.  If you're OK with removing the 
method, I think that's the best one.

bq. How about we use 001 patch but use EnumSet for NOT_RUNNING_STATES?

And directly use {{NOT_RUNNING_STATES.contains(lifeCycle.getCurrentState()}}, 
right?  I'm fine with that one, too.

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-749) Create constant for set of not running states

2019-11-19 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-749:


[~szetszwo], [~shashikant], may I ask you take a look at this change?

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (RATIS-749) Create constant for set of not running states

2019-11-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai edited comment on RATIS-749 at 11/10/19 1:23 PM:
--

Attached two patches:

* [^RATIS-749.001.patch] is a trivial change, replaces varargs at the single 
place mentioned in issue description with an array
*  [^RATIS-749.001b.patch] is a little more involved, it changes {{isOneOf}} 
and {{assertCurrentState}} to accept {{Set}}, and adds predefined 
{{Set}} instances for all calls


was (Author: adoroszlai):
Attached two patches:

* [^RATIS-749.001.patch] is a trivial change, replaces varargs at the single 
place mentioned in issue description with an array
*  [^RATIS-749.001b.patch] is a little more involved, it changes the method to 
accept {{Set}}, and adds predefined {{Set}} instances for all calls of 
{{isOneOf}} and {{assertCurrentState}}

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (RATIS-749) Create constant for set of not running states

2019-11-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai edited comment on RATIS-749 at 11/10/19 1:23 PM:
--

Attached two patches:

* [^RATIS-749.001.patch] is a trivial change, replaces varargs at the single 
place mentioned in issue description with an array
*  [^RATIS-749.001b.patch] is a little more involved, it changes the method to 
accept {{Set}}, and adds predefined {{Set}} instances for all calls of 
{{isOneOf}} and {{assertCurrentState}}


was (Author: adoroszlai):
Attached two patches:

* [^RATIS-749.001.patch] is a trivial change, replaces varargs at the single 
place mentioned in issue description with an array
*  [^RATIS-749.001b.patch] is a little more involved, it changes the method to 
accept {{Set}}, and adds predefined {{Set}}s for all calls of 
{{isOneOf}} and {{assertCurrentState}}

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-749) Create constant for set of not running states

2019-11-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-749:
---
Attachment: RATIS-749.001b.patch
RATIS-749.001.patch

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, 
> allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-749) Create constant for set of not running states

2019-11-10 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-749:
---
Summary: Create constant for set of not running states  (was: Create 
constant for set of "not running" states)

> Create constant for set of not running states
> -
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-749) Create constant for set of "not running" states

2019-11-08 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-749:
---
Attachment: allocations.png

> Create constant for set of "not running" states
> ---
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
> Attachments: allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (RATIS-749) Create constant for set of "not running" states

2019-11-08 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai updated RATIS-749:
---
Labels: performance  (was: )

> Create constant for set of "not running" states
> ---
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
>  Issue Type: Improvement
>  Components: server
>Reporter: Attila Doroszlai
>Priority: Minor
>  Labels: performance
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
> {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
>   return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
>   protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (RATIS-749) Create constant for set of "not running" states

2019-11-08 Thread Attila Doroszlai (Jira)
Attila Doroszlai created RATIS-749:
--

 Summary: Create constant for set of "not running" states
 Key: RATIS-749
 URL: https://issues.apache.org/jira/browse/RATIS-749
 Project: Ratis
  Issue Type: Improvement
  Components: server
Reporter: Attila Doroszlai


{{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of 
{{LifeCycle$State#isOneOf}} upon each call:

{code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
boolean isRunning() {
  return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
}
{code}

This is frequently called (indirectly) from the main loop:

{code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
  protected void runAppenderImpl() throws InterruptedException, IOException {
while (isAppenderRunning()) {
{code}

There should be a constant array defined with these states to reduce GC.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (RATIS-728) TimeoutScheduler for GrpcLogAppender holds on to the AppendEntryRequest till it times out even though request succeeds

2019-10-24 Thread Attila Doroszlai (Jira)


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

Attila Doroszlai commented on RATIS-728:


Thanks [~szetszwo] and [~shashikant].  If I read correctly, RATIS-715 is also 
fixed by this.

> TimeoutScheduler for GrpcLogAppender holds on to the AppendEntryRequest till 
> it times out even though request succeeds
> --
>
> Key: RATIS-728
> URL: https://issues.apache.org/jira/browse/RATIS-728
> Project: Ratis
>  Issue Type: Bug
>  Components: gRPC
>Reporter: Shashikant Banerjee
>Assignee: Tsz-wo Sze
>Priority: Major
> Fix For: 0.5.0
>
> Attachments: r728_20191023.patch, r728_20191023b.patch
>
>
> As discussed in RATIS-726, we need a similar fix for Append Request in 
> GrpcLogAppender to remove the references to appendEntryRequest as soon as the 
> response is received, thereby avoiding any memory pressure creation on the 
> server.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)