Wweiei opened a new issue, #5782:
URL: https://github.com/apache/shenyu/issues/5782

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   1. In divide plugin. If push sync data to nacos or zookeeper, the dataId for 
proxy selector and discovery is not unique, because the suffix dataId for proxy 
selector and discovery is is the name of the selector and not the id. if there 
are two selector and they have the same name, the config will be covered.
   - use nacos as sync center.
   - there are two selector and they have the same name.one selector's upstream 
is 172.16.22.22:17203, the other is 172.16.22.22:17204.
   
![image](https://github.com/user-attachments/assets/f43452d8-e891-47d0-9fe5-519845b485d7)
   
![image](https://github.com/user-attachments/assets/1fbdcaa9-23ea-404e-9341-2674bb0474b1)
   
![image](https://github.com/user-attachments/assets/3d626263-adcb-4352-b22f-a38f3c1ca837)
   
![image](https://github.com/user-attachments/assets/9122ea35-8095-4475-a7e0-5136e637ebaa)
   - There is only one piece of configuration data on nacos。
   
![image](https://github.com/user-attachments/assets/bec1ad55-051e-4599-8073-20bbcd13c5cd)
   
![image](https://github.com/user-attachments/assets/25ab4377-7613-48dd-9dbf-40ab25512996)
   - the discovery config for two selector should have two config with 
different dataId, but only one.
   
![image](https://github.com/user-attachments/assets/8f325ce4-5666-4f96-aba4-18c9cad11599)
   
![image](https://github.com/user-attachments/assets/db71a19b-65bc-42de-9115-5f5030335020)
   
   2. If the selector has a special character like '/test', push sync data to 
nacos will fail due to nacos dataId format validation.
   
![image](https://github.com/user-attachments/assets/59920420-fb90-4adf-82f8-8d4afc3cfc15)
   
![image](https://github.com/user-attachments/assets/b5700c65-540d-4974-89cd-24df9d112576)
   
   
   
   ### Expected Behavior
   
   I think the value for {namespaceId}.proxy.selector.divide.list and 
{namespaceId}..discovery.divide.list is selector's id wiil be better。And the 
detail config dataId's suffix for selector is selectorid too.
   
   ### Steps To Reproduce
   
   1. check out to master branch and pull the lastest code.
   2. use nacos as data sync center.
   3. add two divide selector with same name like 'test'.
   4. change one of the selector's name with a special character '/test'.
   
   ### Environment
   
   ```markdown
   ShenYu version(s): branch master latest
   ```
   
   
   ### Debug logs
   
   ```2024-11-13 14:53:16 [ForkJoinPool.commonPool-worker-15] ERROR 
org.apache.shenyu.admin.listener.nacos.NacosDataChangedListener - Publish data 
to nacos error.
   com.alibaba.nacos.api.exception.NacosException: dataId invalid
        at 
com.alibaba.nacos.client.config.utils.ParamUtils.checkKeyParam(ParamUtils.java:102)
        at 
com.alibaba.nacos.client.config.utils.ParamUtils.checkParam(ParamUtils.java:159)
        at 
com.alibaba.nacos.client.config.NacosConfigService.publishConfigInner(NacosConfigService.java:226)
        at 
com.alibaba.nacos.client.config.NacosConfigService.publishConfig(NacosConfigService.java:131)
        at 
org.apache.shenyu.admin.listener.nacos.NacosDataChangedListener.doPublishConfig(NacosDataChangedListener.java:49)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.publishConfig(AbstractNodeDataChangedListener.java:294)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.lambda$onCommonMultiChanged$13(AbstractNodeDataChangedListener.java:230)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.onCommonMultiChanged(AbstractNodeDataChangedListener.java:230)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.onDiscoveryUpstreamChanged(AbstractNodeDataChangedListener.java:288)
        at 
org.apache.shenyu.admin.listener.DataChangedEventDispatcher.onApplicationEvent(DataChangedEventDispatcher.java:102)
        at 
org.apache.shenyu.admin.listener.DataChangedEventDispatcher.onApplicationEvent(DataChangedEventDispatcher.java:50)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.updateSelectorHandler(UpstreamCheckService.java:435)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.updateHandler(UpstreamCheckService.java:372)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.lambda$check$8(UpstreamCheckService.java:360)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
        at 
java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
        at 
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at 
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at 
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at 
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
   2024-11-13 14:53:16 [ForkJoinPool.commonPool-worker-15] ERROR 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener - 
AbstractNodeDataChangedListener onCommonMultiChanged error 
   org.apache.shenyu.common.exception.ShenyuException: dataId invalid
        at 
org.apache.shenyu.admin.listener.nacos.NacosDataChangedListener.doPublishConfig(NacosDataChangedListener.java:56)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.publishConfig(AbstractNodeDataChangedListener.java:294)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.lambda$onCommonMultiChanged$13(AbstractNodeDataChangedListener.java:230)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.onCommonMultiChanged(AbstractNodeDataChangedListener.java:230)
        at 
org.apache.shenyu.admin.listener.AbstractNodeDataChangedListener.onDiscoveryUpstreamChanged(AbstractNodeDataChangedListener.java:288)
        at 
org.apache.shenyu.admin.listener.DataChangedEventDispatcher.onApplicationEvent(DataChangedEventDispatcher.java:102)
        at 
org.apache.shenyu.admin.listener.DataChangedEventDispatcher.onApplicationEvent(DataChangedEventDispatcher.java:50)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
        at 
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)
        at 
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.updateSelectorHandler(UpstreamCheckService.java:435)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.updateHandler(UpstreamCheckService.java:372)
        at 
org.apache.shenyu.admin.service.impl.UpstreamCheckService.lambda$check$8(UpstreamCheckService.java:360)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
        at 
java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
        at 
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at 
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at 
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at 
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)```
   
   ### Anything else?
   
   _No response_


-- 
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: notifications-unsubscr...@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to