-
Notifications
You must be signed in to change notification settings - Fork 12k
[ISSUE #1515] SYNC_MASTER could be change into pipeline manner #1516
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
… reduce produce latency and improve throughput
|
ping @duhenglucky @vongosling |
|
@shenhui0509 good job, thanks for your contribution, we will review this PR ASAP. |
|
@shenhui0509 and it would be nice if you can pull this request to develop branch |
done |
|
Hi, @duhenglucky, is it necessary to write a RIP? If needed, I'd like to write one. |
@shenhui0509 @duhenglucky I think this pr is so important, A RIP is necessary |
|
@xujianhai666 good suggestion, @shenhui0509 This PR is indeed a relatively big change, and on the critical path, it is best to write a RIP to describe the scope of the relevant changes, as well as the key design in this PR, if you have any other question, please feel free ask me directly. |
RongtongJin
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.
This PR does improve TPS and reduce latency when synchronized replication (Verified by benchmark). There are some issues:
- Transaction message does not seem to work after modification.
- [DISCUSS] When slave down, master return FLUSH_SLAVE_TIMEOUT instead of SLAVE_NOT_AVALIABLE.
2. fix properties when store message 3. add IT for transaction 4. correct resonse code when slave down
|
| final RemotingCommand response = pair.getObject1().processRequest(ctx, cmd); | ||
| doAfterRpcHooks(RemotingHelper.parseChannelRemoteAddr(ctx.channel()), cmd, response); | ||
| CompletableFuture<RemotingCommand> responseFuture = pair.getObject1().asyncProcessRequest(ctx, cmd); | ||
| responseFuture.thenAccept((r) -> { |
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.
I think this anonymous variable r should be changed to response for readability
| String originMsgId = MessageAccessor.getOriginMessageId(msgExt); | ||
| MessageAccessor.setOriginMessageId(msgInner, UtilAll.isBlank(originMsgId) ? msgExt.getMsgId() : originMsgId); | ||
| CompletableFuture<PutMessageResult> putMessageResult = this.brokerController.getMessageStore().asyncPutMessage(msgInner); | ||
| return putMessageResult.thenApply((r) -> { |
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.
I think this anonymous variable r should be changed to response for readability
| SendMessageContext sendMessageContext, | ||
| ChannelHandlerContext ctx, | ||
| int queueIdInt) { | ||
| return putMessageResult.thenApply((r) -> |
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.
I think this anonymous variable r should be changed to putMessageResult for readability
|
Very great optimization. I will pick some time to work with this pr in the next week. |
[ISSUE apache#1515] SYNC_MASTER could be change into pipeline manner
[ISSUE apache#1515] SYNC_MASTER could be change into pipeline manner
[ISSUE apache#1515] SYNC_MASTER could be change into pipeline manner
this commit resolves #1515 change SYNC_MASTER flushSlave/flushDisk to pipeline manner
What is the purpose of the change
performance improvement for SYNC_MASTER :
Brief changelog
Verifying this change
Functional
performance
benchmark config:
2 * broker:48C,512G mem,4 * 2T SSD; 1-master-1-slave
namesrv is hybrid deployed with broker
3 * client : 40C, 64G mem
message size : 1024B
write thread : 64
benchmark result
sync_pipeline is the optimized version configured with SYNC_MASTER
wait is the origin version configured with SYNC_MASTER
async is the origin version configured with ASYNC_MASTER
TPS




Latency
The result shows that the optimized version's performance is close to ASYNC_MASTER.
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyleto make sure basic checks pass. Runmvn clean install -DskipITsto make sure unit-test pass. Runmvn clean test-compile failsafe:integration-testto make sure integration-test pass.