Skip to content

Commit

Permalink
Add fsync.warningthresholdms property to ZooKeeperCommandExecutor
Browse files Browse the repository at this point in the history
Motivation:

It is usual for fsync to take longer than 1 second in a non-prod
environment, so it'd be nice if we have an option that adjusts the
threshold.

    fsync-ing the write ahead log in SyncThread:3 took 1513ms
    which will adversely effect operation latency. File size is
    67108880 bytes. See the ZooKeeper troubleshooting guide.

Modifications:

- Set the system property `zookeeper.fsync.warningthresholdms` when a
  user specified `fsync.warningthresholdms` as an additional property.

Result:

- Closes line#366
  • Loading branch information
trustin committed Apr 3, 2019
1 parent 7b7ea60 commit 349a1e5
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -331,6 +331,10 @@ private EmbeddedZooKeeper startZooKeeper() throws Exception {
copyZkProperty(zkProps, "autopurge.snapRetainCount", "3");
copyZkProperty(zkProps, "autopurge.purgeInterval", "1");

// Set the properties that must be set in System properties.
System.setProperty("zookeeper.fsync.warningthresholdms",
cfg.additionalProperties().getOrDefault("fsync.warningthresholdms", "1000"));

// Set the data directories.
zkProps.setProperty("dataDir", zkDataDir.getPath());
zkProps.setProperty("dataLogDir", zkLogDir.getPath());
Expand Down

0 comments on commit 349a1e5

Please sign in to comment.