xiaobaicai66695 opened a new issue, #3656:
URL: https://github.com/apache/dubbo-go/issues/3656

   ### Environment
   
   - dubbo-go branch: `develop`
   - affected code: `cluster/router/condition/generateConditionsRoute`
   - config center: ZooKeeper
   
   ### Description
   
   The v3.0 condition-router parser assigns the two boolean fields in reverse 
order:
   
   ```go
   force, enable := *routerConfig.Enabled, *routerConfig.Force
   ```
   
   As a result, a normal rule with `enabled: true` and `force: false` is 
interpreted as `enable=false` and `force=true`. `DynamicRouter.Route` then 
bypasses the condition router and returns the original invoker list.
   
   The v3.1 parser is not affected because `generateMultiConditionRoute` reads 
and returns the fields in the correct order.
   
   ### Reproduction
   
   Store the following service-level rule in the config center:
   
   ```yaml
   configVersion: v3.0
   priority: 1
   enabled: true
   force: false
   runtime: true
   key: org.apache.dubbo.quickstart.Greeter:1.0.0:demo
   scope: service
   conditions:
     - method=SayHello => 
application=router-rule-e2e-condition-provider-hangzhou
   ```
   
   Use two providers whose final consumer-side invoker URLs contain different 
`application` values. Calls continue to select both providers because the v3.0 
router is treated as disabled.
   
   Changing the same rule to v3.1 enters the separate multi-destination parser 
and routes normally.
   
   ### Expected behavior
   
   - `enabled` controls whether the router executes.
   - `force` controls whether an empty routing result falls back to the 
original invokers.
   - Updating the same config-center node from v3.1 to v3.0 should replace the 
router state and apply the v3.0 condition immediately.
   
   ### Proposed fix
   
   Assign the fields in their declared order and add regression coverage for 
the asymmetric `enabled: true` / `force: false` combination, including a 
v3.1-to-v3.0 runtime update.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to