-
Notifications
You must be signed in to change notification settings - Fork 98
[dvc][server] Add exponential backoff to other HelixUtils methods with retries #1784
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
f780377
287fcb3
84a0c2d
c727af7
5f0db90
000b7d7
205c0ee
2ed6743
efa526a
9f9e570
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,7 @@ public class HelixReadOnlyStoreRepository extends CachedReadOnlyStoreRepository | |
public HelixReadOnlyStoreRepository( | ||
ZkClient zkClient, | ||
HelixAdapterSerializer compositeSerializer, | ||
String clusterName, | ||
int refreshAttemptsForZkReconnect, | ||
long refreshIntervalForZkReconnectInMs) { | ||
String clusterName) { | ||
/** | ||
* HelixReadOnlyStoreRepository is used in router, server, fast-client, da-vinci and system store. | ||
* Its centralized locking should NOT be shared with other classes. Create a new instance. | ||
|
@@ -118,15 +116,12 @@ protected void onRepositoryChanged(Collection<String> newZkStoreNames) { | |
|
||
private final CachedResourceZkStateListener zkStateListener = new CachedResourceZkStateListener(this); | ||
|
||
private final IZkChildListener zkStoreRepositoryListener = new IZkChildListener() { | ||
@Override | ||
public void handleChildChange(String path, List<String> children) { | ||
if (!path.equals(clusterStoreRepositoryPath)) { | ||
LOGGER.warn("Notification path mismatch, path={}, expected={}.", path, clusterStoreRepositoryPath); | ||
return; | ||
} | ||
onRepositoryChanged(children); | ||
private final IZkChildListener zkStoreRepositoryListener = (path, children) -> { | ||
if (!path.equals(clusterStoreRepositoryPath)) { | ||
LOGGER.warn("Notification path mismatch, path={}, expected={}.", path, clusterStoreRepositoryPath); | ||
return; | ||
} | ||
onRepositoryChanged(children); | ||
Comment on lines
-121
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we change this to lambda function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgot to mention it in my comment: In the docs, I found no mentions in the style guide regarding lambda functions, but it was suggested to me as a refactoring by Intellij, and thought I could suggest it as a change. Although, in retrospect, I should've proposed this in another PR as this outside the scope of this current PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have a style guide against lambda functions. I just wanted to confirm what prompted this change, and to verify if the functionality is the same. |
||
}; | ||
|
||
private final IZkDataListener zkStoreListener = new IZkDataListener() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ public HelixReadOnlyZKSharedSystemStoreRepository( | |
ZkClient zkClient, | ||
HelixAdapterSerializer compositeSerializer, | ||
String systemStoreClusterName) { | ||
super(zkClient, compositeSerializer, systemStoreClusterName, 0, 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What were these 0 values for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For public HelixReadOnlyStoreRepository(
ZkClient zkClient,
HelixAdapterSerializer compositeSerializer,
String clusterName,
int refreshAttemptsForZkReconnect,
long refreshIntervalForZkReconnectInMs) {
/**
* HelixReadOnlyStoreRepository is used in router, server, fast-client, da-vinci and system store.
* Its centralized locking should NOT be shared with other classes. Create a new instance.
*/
super(zkClient, clusterName, compositeSerializer, new ClusterLockManager(clusterName));
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. I wonder why it was setup like this in the first place. |
||
super(zkClient, compositeSerializer, systemStoreClusterName); | ||
// Initialize the necessary zk shared system stores | ||
for (VeniceSystemStoreType type: VeniceSystemStoreType.values()) { | ||
if (type.isNewMedataRepositoryAdopted()) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ public SubscriptionBasedStoreRepository( | |
ZkClient zkClient, | ||
HelixAdapterSerializer compositeSerializer, | ||
String clusterName) { | ||
super(zkClient, compositeSerializer, clusterName, 0, 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same reason |
||
super(zkClient, compositeSerializer, clusterName); | ||
} | ||
|
||
@Override | ||
|
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 don't think we should modify the sleep internval here. Please read the above comment as to why it's setup like this.
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.
Reverted in 84a0c2d