[jira] [Resolved] (ZOOKEEPER-3821) improve getting snapCount and globalOutstandingLimit from System's Property

2021-06-13 Thread Ling Mao (Jira)


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

Ling Mao resolved ZOOKEEPER-3821.
-
Resolution: Fixed

> improve getting snapCount and globalOutstandingLimit  from System's Property
> 
>
> Key: ZOOKEEPER-3821
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3821
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: server
>Reporter: Ling Mao
>Priority: Minor
>  Labels: pull-request-available
>  Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> We have System.getProperty(SNAP_COUNT, defaultValue), we don't need to set 
> the default value in an exception, that's not elegant 
> {code:java}
> public static int getSnapCount() {
> String sc = System.getProperty(SNAP_COUNT);
> try {
> int snapCount = Integer.parseInt(sc);// snapCount must be 2 
> or more. See org.apache.zookeeper.server.SyncRequestProcessor
> if (snapCount < 2) {
> LOG.warn("SnapCount should be 2 or more. Now, snapCount is reset 
> to 2");
> snapCount = 2;
> }
> return snapCount;
> } catch (Exception e) {
> return 10;
> }
> }public int getGlobalOutstandingLimit() {
> String sc = System.getProperty(GLOBAL_OUTSTANDING_LIMIT);
> int limit;
> try {
> limit = Integer.parseInt(sc);
> } catch (Exception e) {
> limit = 1000;
> }
> return limit;
> }
> {code}



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


[jira] [Resolved] (ZOOKEEPER-4312) ZooKeeperServerEmbedded: enhance server start/stop for testability

2021-06-13 Thread Damien Diederen (Jira)


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

Damien Diederen resolved ZOOKEEPER-4312.

Fix Version/s: 3.7.1
   3.8.0
   Resolution: Fixed

Issue resolved by pull request 1710
[https://github.com/apache/zookeeper/pull/1710]

> ZooKeeperServerEmbedded: enhance server start/stop for testability
> --
>
> Key: ZOOKEEPER-4312
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4312
> Project: ZooKeeper
>  Issue Type: Improvement
>  Components: server
>Affects Versions: 3.7.0
>Reporter: Enrico Olivelli
>Assignee: Enrico Olivelli
>Priority: Major
>  Labels: pull-request-available
> Fix For: 3.8.0, 3.7.1
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> ZooKeeperServerEmbedded works well for running ZooKeeper but it lacks support 
> for a few little features in order to use it for tests.
> I saw these problems while working on the port of Curator Testing Server to 
> ZooKeeperServerEmbedded.
>  * There is no wait to wait for the server to be up-and-running
>  * When you "close()" the server, it does not wait for the ports to be closed
>  * There is no wait to have the ConnectString for the server



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


[jira] [Created] (ZOOKEEPER-4318) Only report the follower sync time metrics if sync is completed

2021-06-13 Thread Li Wang (Jira)
Li Wang created ZOOKEEPER-4318:
--

 Summary: Only report the follower sync time metrics if sync is 
completed
 Key: ZOOKEEPER-4318
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4318
 Project: ZooKeeper
  Issue Type: Improvement
  Components: metric system
Affects Versions: 3.8
Reporter: Li Wang
 Fix For: 3.7.1, 3.8


We should calculate the sync time only if completedSync is true. Otherwise, we 
will get noisy data such as 0 sync time in cases where sync immediately failed 
(due to network partition for example).



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