Repository: zookeeper
Updated Branches:
refs/heads/branch-3.4 fc346f2a0 -> c6a9fcd15
ZOOKEEPER-3062: mention fsync.warningthresholdms in FileTxnLog LOG.warn message
https://issues.apache.org/jira/browse/ZOOKEEPER-3062
Author: Christine Poerschke <cpoerschke@bloomberg.net>
Reviewers: phunt@apache.org
Closes #566 from cpoerschke/master-ZOOKEEPER-3062 and squashes the following commits:
2bcccf62d [Christine Poerschke] Action code review feedback.
a2dc484d4 [Christine Poerschke] ZOOKEEPER-3062: mention fsync.warningthresholdms in FileTxnLog
LOG.warn message
Change-Id: Id675e61a9ef0b247d65eaa36bb88c8569d177c49
(cherry picked from commit 7cf8035c3a5ca05bce2d183b41bf410709a5f6ee)
Signed-off-by: Patrick Hunt <phunt@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/c6a9fcd1
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/c6a9fcd1
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/c6a9fcd1
Branch: refs/heads/branch-3.4
Commit: c6a9fcd158a7ae68664dcfadd88706648de35c21
Parents: fc346f2
Author: Christine Poerschke <cpoerschke@bloomberg.net>
Authored: Wed Aug 1 12:19:34 2018 -0700
Committer: Patrick Hunt <phunt@apache.org>
Committed: Wed Aug 1 12:21:10 2018 -0700
----------------------------------------------------------------------
.../org/apache/zookeeper/server/persistence/FileTxnLog.java | 7 +++++--
.../apache/zookeeper/server/persistence/FileTxnLogTest.java | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/c6a9fcd1/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
index b1cd006..95462e7 100644
--- a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
+++ b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
@@ -99,6 +99,9 @@ public class FileTxnLog implements TxnLog {
public static final String LOG_FILE_PREFIX = "log";
+ static final String FSYNC_WARNING_THRESHOLD_MS_PROPERTY = "fsync.warningthresholdms";
+ static final String ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY = "zookeeper." + FSYNC_WARNING_THRESHOLD_MS_PROPERTY;
+
/** Maximum time we allow for elapsed fsync before WARNing */
private final static long fsyncWarningThresholdMS;
@@ -107,8 +110,8 @@ public class FileTxnLog implements TxnLog {
/** Local variable to read fsync.warningthresholdms into */
Long fsyncWarningThreshold;
- if ((fsyncWarningThreshold = Long.getLong("zookeeper.fsync.warningthresholdms"))
== null)
- fsyncWarningThreshold = Long.getLong("fsync.warningthresholdms", 1000);
+ if ((fsyncWarningThreshold = Long.getLong(ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY))
== null)
+ fsyncWarningThreshold = Long.getLong(FSYNC_WARNING_THRESHOLD_MS_PROPERTY, 1000);
fsyncWarningThresholdMS = fsyncWarningThreshold;
}
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/c6a9fcd1/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
----------------------------------------------------------------------
diff --git a/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java b/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
index 8b74fa7..122459e 100644
--- a/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
+++ b/src/java/test/org/apache/zookeeper/server/persistence/FileTxnLogTest.java
@@ -116,7 +116,7 @@ public class FileTxnLogTest extends ZKTestCase {
// Given ...
// Set threshold to -1, as after the first commit it takes 0ms to commit to disk.
- java.lang.System.setProperty("zookeeper.fsync.warningthresholdms", "-1");
+ java.lang.System.setProperty(FileTxnLog.ZOOKEEPER_FSYNC_WARNING_THRESHOLD_MS_PROPERTY,
"-1");
ServerStats.Provider providerMock = mock(ServerStats.Provider.class);
ServerStats serverStats = new ServerStats(providerMock);
|