From 2d020adcb6f6bea90140ba96afb62e3367542d4b Mon Sep 17 00:00:00 2001 From: PapaCharlie Date: Thu, 18 Jul 2024 09:47:44 -0700 Subject: [PATCH 1/4] Respect glob collection subscriptions on reconnect The RetryTask did not resubscribe to glob collections after a reconnect. Instead it goes back to map subscriptions. This change honors the glob collection config in the retry task. --- CHANGELOG.md | 6 +++++- .../java/com/linkedin/d2/xds/XdsClientImpl.java | 15 +++++++++++---- gradle.properties | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 566aa0bcf4..bf4550d9f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [29.57.3] - 2024-07-18 +- Respect glob collection subscriptions on reconnect + ## [29.57.2] - 2024-06-17 - Update grpc version to 1.59.1 and protobuf to 3.24.0 @@ -5707,7 +5710,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.57.2...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.57.3...master +[29.57.3]: https://github.com/linkedin/rest.li/compare/v29.57.2...v29.57.3 [29.57.2]: https://github.com/linkedin/rest.li/compare/v29.57.1...v29.57.2 [29.57.1]: https://github.com/linkedin/rest.li/compare/v29.57.0...v29.57.1 [29.57.0]: https://github.com/linkedin/rest.li/compare/v29.56.1...v29.57.0 diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java b/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java index ee4e25231f..24a4f74e14 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java @@ -692,11 +692,18 @@ final class RpcRetryTask implements Runnable { public void run() { startRpcStreamLocal(); for (ResourceType type : ResourceType.values()) { - Map subscriberMap = getResourceSubscriberMap(type); - Collection resources = subscriberMap.isEmpty() ? null : subscriberMap.keySet(); - if (resources != null) { - _adsStream.sendDiscoveryRequest(type, resources); + Collection resources = getResourceSubscriberMap(type).keySet(); + if (resources.isEmpty()) + { + continue; + } + if (_subscribeToUriGlobCollection && type == ResourceType.D2_URI_MAP) + { + resources = resources.stream() + .map(GlobCollectionUtils::globCollectionUrlForClusterResource) + .collect(Collectors.toSet()); } + _adsStream.sendDiscoveryRequest(type, resources); } } } diff --git a/gradle.properties b/gradle.properties index e8093e6764..a267ef0ca8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.57.2 +version=29.57.3 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true From d8c7c54e248d079bcf549b0e1c6f1c0ced9822fd Mon Sep 17 00:00:00 2001 From: PapaCharlie Date: Wed, 4 Sep 2024 08:34:55 -0700 Subject: [PATCH 2/4] Update CHANGELOG --- CHANGELOG.md | 23 +++++++++++++++++++---- gradle.properties | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf4550d9f5..a094c64db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,19 @@ and what APIs have changed, if applicable. ## [Unreleased] -## [29.57.3] - 2024-07-18 -- Respect glob collection subscriptions on reconnect +## [29.58.4] - 2024-09-03 + +## [29.58.3] - 2024-08-12 +- Disable the warmUp flaky unit test + +## [29.58.2] - 2024-08-06 +- Add try/catch logic for INDIS xds stream initialization + +## [29.58.1] - 2024-07-19 +- Increase verbosity of testExtensionSchemaValidation tests + +## [29.58.0] - 2024-07-11 +- Allow both @extension and @grpcExtension extensions in schema validation ## [29.57.2] - 2024-06-17 - Update grpc version to 1.59.1 and protobuf to 3.24.0 @@ -5710,8 +5721,12 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.57.3...master -[29.57.3]: https://github.com/linkedin/rest.li/compare/v29.57.2...v29.57.3 +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.58.4...master +[29.58.4]: https://github.com/linkedin/rest.li/compare/v29.58.3...v29.58.4 +[29.58.3]: https://github.com/linkedin/rest.li/compare/v29.58.2...v29.58.3 +[29.58.2]: https://github.com/linkedin/rest.li/compare/v29.58.1...v29.58.2 +[29.58.1]: https://github.com/linkedin/rest.li/compare/v29.58.0...v29.58.1 +[29.58.0]: https://github.com/linkedin/rest.li/compare/v29.57.2...v29.58.0 [29.57.2]: https://github.com/linkedin/rest.li/compare/v29.57.1...v29.57.2 [29.57.1]: https://github.com/linkedin/rest.li/compare/v29.57.0...v29.57.1 [29.57.0]: https://github.com/linkedin/rest.li/compare/v29.56.1...v29.57.0 diff --git a/gradle.properties b/gradle.properties index a267ef0ca8..8782188e30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.57.3 +version=29.58.4 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true From 15e436eb82388c78f2441f88396e2e8c3ec377f3 Mon Sep 17 00:00:00 2001 From: PapaCharlie Date: Wed, 4 Sep 2024 08:35:52 -0700 Subject: [PATCH 3/4] Bump version --- CHANGELOG.md | 7 ++++++- gradle.properties | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a094c64db1..2120d7f9d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,11 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [29.58.5] - 2024-09-04 +- Respect glob collection subscriptions on reconnect + ## [29.58.4] - 2024-09-03 +- Respect `startPublishing` call by always re-notifying watcher in XdsClientImpl ## [29.58.3] - 2024-08-12 - Disable the warmUp flaky unit test @@ -5721,7 +5725,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.58.4...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.58.5...master +[29.58.5]: https://github.com/linkedin/rest.li/compare/v29.58.4...v29.58.5 [29.58.4]: https://github.com/linkedin/rest.li/compare/v29.58.3...v29.58.4 [29.58.3]: https://github.com/linkedin/rest.li/compare/v29.58.2...v29.58.3 [29.58.2]: https://github.com/linkedin/rest.li/compare/v29.58.1...v29.58.2 diff --git a/gradle.properties b/gradle.properties index 8782188e30..ba684a867a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.58.4 +version=29.58.5 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true From e49394bc6ce74f6b785100ab861d1f34ca044826 Mon Sep 17 00:00:00 2001 From: PapaCharlie Date: Wed, 4 Sep 2024 10:58:02 -0700 Subject: [PATCH 4/4] Fix type used during resubscribe --- d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java b/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java index 426a54ab39..b5ee6b0126 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsClientImpl.java @@ -705,6 +705,7 @@ public void run() { resources = resources.stream() .map(GlobCollectionUtils::globCollectionUrlForClusterResource) .collect(Collectors.toSet()); + type = ResourceType.D2_URI; } _adsStream.sendDiscoveryRequest(type, resources); } @@ -943,8 +944,8 @@ public void onCompleted() private void sendDiscoveryRequest(ResourceType type, Collection resources) { _log.info("Sending {} request for resources: {}", type, resources); - DiscoveryRequestData request = new DiscoveryRequestData(_node, type, resources); - _requestWriter.onNext(request.toEnvoyProto()); + DeltaDiscoveryRequest request = new DiscoveryRequestData(_node, type, resources).toEnvoyProto(); + _requestWriter.onNext(request); _log.debug("Sent DiscoveryRequest\n{}", request); }