-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
[ISSUE #6728] Compute the confirmOffset without considering new connections #6729
[ISSUE #6728] Compute the confirmOffset without considering new connections #6729
Conversation
…ctions. 2. When compute the confirmOffset, use getConfirmOffsetDirectly() to avoid the endless calling.
long slaveAckOffset = connection.getSlaveAckOffset(); | ||
if (slaveAckOffset <= 0) { | ||
// Slave's connection is just inited, the ack hasn't been calculated. | ||
// So skip this ackOffset. | ||
continue; | ||
} |
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.
if (currentSyncStateSet.contains(slaveId) && connection.getSlaveAckOffset() > 0) {
...
}
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.
Yes, I have optimized this logic as you said.
Codecov Report
@@ Coverage Diff @@
## develop #6729 +/- ##
=============================================
- Coverage 42.88% 42.83% -0.05%
+ Complexity 9009 8995 -14
=============================================
Files 1113 1113
Lines 78587 78601 +14
Branches 10221 10224 +3
=============================================
- Hits 33700 33667 -33
- Misses 40669 40711 +42
- Partials 4218 4223 +5
... and 32 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
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.
LGTM~
… connections (apache#6729) * 1. When compute the confirmOffset, dismiss the ackOffset of new connections. 2. When compute the confirmOffset, use getConfirmOffsetDirectly() to avoid the endless calling. * use the calculated slaveAckOffset * optimize the logic.
[ISSUE #6728] Compute the confirmOffset without considering new connections.
Which Issue(s) This PR Fixes
Fixes #6728
Brief Description
How Did You Test This Change?