-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RATIS-2176. Update doc for raft.server.log.appender.wait-time.min. #1181
base: master
Are you sure you want to change the base?
Conversation
The failed test is unrelated. |
| **Default** | 10ms | | ||
| **Property** | `raft.server.log.appender.wait-time.min` | | ||
|:----------------|:---------------------------------------------------------------------------| | ||
| **Description** | wait time between two subsequent AppendEntries. Must be a positive number. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jojochuang , thanks a lot for working on this!
This conf has two purposes:
- wait time between two subsequent AppendEntries, and
- set to waitForReady in
GrpcLogAppender
(for the sleep waiting a gRPC stream to ready).
For (1), zero is allowed. For (2), zero becomes 1ms.
Do you think that the usage in (2) is problematic? If yes, we may use a different conf.
Actually, just updating the doc is not sufficient. GrpcLogAppender.StreamObservers.onNext() calls sleep for waitForReady, but internally it uses Thread.sleep() so it is never going to be less than one millisecond. I'm looking at an Ozone cluster where follower DataNode completes the append follower_append_entry_latency just 0.66ms, but the leader's log_appender_latency is 1.36ms. Clearly, the one millisecond sleep granulaity is the problem for the append latency. |
sleep(waitForReady, isHeartBeat); | ||
//sleep(waitForReady, isHeartBeat); | ||
LockSupport.parkNanos(waitForReady.toLong(TimeUnit.NANOSECONDS)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jojochuang , thanks for the update! Sorry that I missed the new change earlier.
How about changing it in the sleep(..) method?
@@ -408,12 +409,9 @@ public class GrpcLogAppender extends LogAppenderBase {
private static void sleep(TimeDuration waitTime, boolean heartbeat)
throws InterruptedIOException {
- try {
- waitTime.sleep();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw IOUtils.toInterruptedIOException(
- "Interrupted appendLog, heartbeat? " + heartbeat, e);
+ LockSupport.parkNanos(waitTime.toLong(TimeUnit.NANOSECONDS));
+ if (Thread.currentThread().isInterrupted()) {
+ throw new InterruptedIOException("Interrupted appendLog, heartbeat? " + heartbeat);
}
}
What changes were proposed in this pull request?
RATIS-1886 updated the default value of raft.server.log.appender.wait-time.min but didn't update the doc.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2176
How was this patch tested?
User doc change. No production code change.