-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve] [client]Add new ServiceUrlProvider implementation: SameAuthParamsAutoClusterFailover #23129
[improve] [client]Add new ServiceUrlProvider implementation: SameAuthParamsAutoClusterFailover #23129
Conversation
…ParamsAutoClusterFailover
/pulsarbot rerun-failure-checks |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23129 +/- ##
============================================
+ Coverage 73.57% 74.52% +0.95%
- Complexity 32624 33624 +1000
============================================
Files 1877 1920 +43
Lines 139502 144430 +4928
Branches 15299 15804 +505
============================================
+ Hits 102638 107637 +4999
+ Misses 28908 28534 -374
- Partials 7956 8259 +303
Flags with carried forward coverage won't be shown. Click here to find out more.
|
PersistentTopicInternalStats internalStats = admin.topics().getInternalStats(topicName); | ||
ManagedLedgerInternalStats.CursorStats cursorStats2 = internalStats.cursors.get("s2"); | ||
String[] ledgerIdAndEntryId2 = cursorStats2.markDeletePosition.split(":"); | ||
ImmutablePositionImpl actMarkDeletedPos2 = |
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.
There shouldn't be a need to use ImmutablePositionImpl in code. Simply use Position as the type and PositionFactory to create instances. They will be immutable by default.
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.
Created a new PR to revert it
log.info("Expected mark deleted position: {}", expectedMarkDeletedPos); | ||
log.info("Actual mark deleted position: {}", cursorStats.markDeletePosition); | ||
assertTrue(actMarkDeletedPos.compareTo(expectedMarkDeletedPos) >= 0); | ||
AssertJUnit.assertTrue(actMarkDeletedPos.compareTo(expectedMarkDeletedPos) >= 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.
AssertJUnit shouldn't be needed
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.
Created a new PR to revert it
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.
What is the purpose of this test in this PR? Is it unrelated?
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.
Created a new PR to revert it
…ParamsAutoClusterFailover (apache#23129) - excluding changes to pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonDurableSubscriptionTest.java PR apache#23168 (cherry picked from commit 06a2f5c) (cherry picked from commit 286a5dc)
…ParamsAutoClusterFailover (apache#23129) - excluding changes to pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonDurableSubscriptionTest.java PR apache#23168 (cherry picked from commit 06a2f5c) (cherry picked from commit 286a5dc)
…ParamsAutoClusterFailover (apache#23129) - excluding changes to pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonDurableSubscriptionTest.java PR apache#23168 (cherry picked from commit 06a2f5c) (cherry picked from commit 286a5dc)
…ParamsAutoClusterFailover (#23129)
…ParamsAutoClusterFailover (apache#23129)
Motivation
Background
So far, there are two implementations of
ServiceUrlProvider
ControlledClusterFailover
: call an HTTP API to change the pulsar service URL.AutoClusterFailover
: check the pulsar service URL by creating a socket, and automatically switch to the high-priority pulsar service URL.Issue
c1
andc2
, and start a binary-way replication between them.AutoClusterFailover
for our client to switch connections to the healthy cluster when the primary one can not work.client -> proxy -> brokers
If all the brokers crash, the proxies are still healthy,
AutoClusterFailover
can not determine that the primary cluster can not provide service anymore.Modifications
Add a new ServiceUrlProvider implementation:
SameAuthParamsAutoClusterFailover
, which useslookup topic
to check whether the target cluster is healthy or not. Since the clusters that enabled Geo-Replication always have the same auth settings, it can be easy to implement(skipping the different auth settings ).Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x