-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[Summer of code] Use confirm offset in ReputMessageService #4449
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
[Summer of code] Use confirm offset in ReputMessageService #4449
Conversation
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.
在doReut方法中当已controller方式启动时没有开启ConfirmOffset的能力
if (this.defaultMessageStore.getMessageStoreConfig().getBrokerRole() == BrokerRole.SYNC_MASTER) { | ||
final Set<String> currentSyncStateSet = getSyncStateSet(); | ||
long confirmOffset = this.defaultMessageStore.getMaxPhyOffset(); | ||
for (HAConnection connection : this.connectionList) { | ||
if (currentSyncStateSet.contains(connection.getClientAddress())) { | ||
confirmOffset = Math.min(confirmOffset, connection.getSlaveAckOffset()); | ||
} | ||
} | ||
return confirmOffset; | ||
} else { | ||
if (this.haClient != null) { | ||
return this.haClient.getConfirmOffset(); |
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.
这里可以做一个优化。。把confirmOffset记录下来,利用空间换时间,再每次slave ack的时候更新。。不然每次reput一条消息都会调用一下,比较消耗资源。
问题场景: 网络分区下, master 与 slave, master 与 controller 都分区了, 但是没有和 client 分区. client 继续往 master 发送消息. 虽然在 allAckSyncStateSet = true 下, 不会发送成功, 但是这些消息仍然会被 reput by reputMessageService. |
Codecov Report
@@ Coverage Diff @@
## 5.0.0-beta-dledger-controller #4449 +/- ##
===================================================================
+ Coverage 43.17% 43.28% +0.10%
- Complexity 6343 6369 +26
===================================================================
Files 841 841
Lines 59824 59857 +33
Branches 8152 8161 +9
===================================================================
+ Hits 25830 25909 +79
+ Misses 30643 30594 -49
- Partials 3351 3354 +3
Continue to review full report at Codecov.
|
Make sure set the target branch to
develop
What is the purpose of the change
tracking issue: #4330
Brief changelog
Use confirm offset in ReputMessageService
Verifying this change
XXXX
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:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.