-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-5763. Provide an Executor for each LocalStream in ContainerStateMachine #2782
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
Conversation
captainzmc
left a comment
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.
Thanks @szetszwo. Overall LGTM, only a few minor comments. Also there is a problem with checkstyle.
| this.clientPoolSize = clientPoolSize; | ||
| } | ||
|
|
||
| @Config(key = "datastream.async.write.thread.pool.size", |
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.
In the previous implementation we added datastream.write.threads, so we just need to reuse the previous key.
| conf.getObject(DatanodeRatisServerConfig.class) | ||
| .getAsyncWriteThreadPoolPoolSize(); | ||
| RaftServerConfigKeys.DataStream.setAsyncWriteThreadPoolSize(properties, | ||
| asyncWriteThreadPoolPoolSize); |
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.
This property is already set on line 245, so it not need set here.
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.
Oops, you are right. We already have set it.
|
@captainzmc , thanks a lot for reviewing this and pointing out that raft.server.data-stream.async.write.thread.pool.size has already been set in XceiverServerRatis. Just have updated the JIRA, this pull request and pushed a new commit. |
| Paths.get(response.getMessage())); | ||
| final ExecutorService chunkExecutor = requestProto.hasWriteChunk() ? | ||
| getChunkExecutor(requestProto.getWriteChunk()) : null; | ||
| return new LocalStream(channel, chunkExecutor); |
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.
Hi @szetszwo, The size of the chunkExecutors is determined by dfs.container.ratis.num.write.chunk.threads.per.volume. So I'm wondering if we need delete datastream.write.threads in DatanodeRatisServerConfig? Now that we're passing in chunkExecutor every time, this configuration should be useless?
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.
@captainzmc , you are right. Let's remove it.
|
@captainzmc , just have pushed a new commit. Please take a look. BTW, filed https://issues.apache.org/jira/browse/RATIS-1419 for changing the fixed thread pools in DataStreamManagement to cached thread pools in order to reduce the resources usage when the executors are idle. |
Good idea, Currently ContainerStateMachine also uses newFixedThreadPool. Perhaps we can replace it with newCachedThreadPool in RATIS-1419. |
captainzmc
left a comment
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.
+1, change looks good.
The CI of Ozone is very unstable recently. I looked at the failed CI and it had nothing to do with this PR. Let's merge this PR first.
…Machine (apache#2782) (cherry picked from commit e4a0f00)
What changes were proposed in this pull request?
RATIS-1406 added a new API for providing an Executor to StateMachine.DataStream. In this JIRA, we use this new API to provide an Executor for each LocalStream in ContainerStateMachine.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-5763
How was this patch tested?
No new tests are needed.