Copilot commented on code in PR #7060:
URL: https://github.com/apache/shenyu/pull/7060#discussion_r4024809563
##########
shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractPathDataSyncService.java:
##########
@@ -130,14 +130,21 @@ private void proxyHandlerEvent(final String updatePath,
final String updateData,
}
private void discoveryUpstreamHandlerEvent(final String updatePath, final
String updateData, final EventType eventType) {
- String[] pathInfoArray2 = updatePath.split("/");
- if (pathInfoArray2.length != 5) {
+ String[] pathInfoArray = updatePath.split("/");
+ if (pathInfoArray.length != 5) {
return;
}
- if (!EventType.DELETE.equals(eventType)) {
- Optional.ofNullable(updateData)
- .ifPresent(e ->
cacheDiscoveryUpstreamData(GsonUtils.getInstance().fromJson(updateData,
DiscoverySyncData.class)));
+ String pluginName = pathInfoArray[pathInfoArray.length - 2];
+ String selectorId = pathInfoArray[pathInfoArray.length - 1];
+ if (EventType.DELETE.equals(eventType)) {
Review Comment:
This branch only helps once the DELETE reaches `event`, but the Zookeeper
adapter currently returns before dispatching whenever `data` is null.
`CuratorCache` supplies the deleted node as `oldData` and `null` as `data` for
`NODE_DELETED`, so Zookeeper discovery-upstream deletions still never reach
this code. Please update that adapter to dispatch DELETE using `oldData` (or
move the data guard to the PUT path); otherwise the advertised Zookeeper
coverage is not fixed.
This issue also appears on line 143 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]