hehuang139 opened a new pull request, #16525:
URL: https://github.com/apache/dubbo/pull/16525

   ## What is the purpose of the change?
   
   Fixes #15641.
   
   With local metadata and both `dubbo` and `tri` protocols, MetadataService V1 
can be exported over Dubbo while the advertised URL points to the Triple V2 
endpoint. A Dubbo 3.1.11 consumer then calls the V1 interface on that endpoint 
and fails with `UNIMPLEMENTED: Invoker for gRPC not found`, even with 
`only-use-metadata-v2=false`.
   
   Export both metadata versions over Triple when V2 is enabled and advertise 
the V1 URL parameters for compatibility. Keep the V2 capability marker so 
current consumers still negotiate V2. Honor an explicit metadata protocol from 
either the application property or its parameters map when deciding whether to 
enable V2.
   
   Validation on Linux with JDK 17 and Maven 3.9.9:
   
   - An independent released Dubbo 3.1.11 consumer reproduced the error against 
the original provider and retrieved metadata successfully after the fix.
   - Passed 8 tests: seven real RPC cases covering mixed protocols, Triple 
dual-version/V2-only, Dubbo-only, and explicit metadata protocol settings, plus 
the existing URL customizer test. The RPC cases check legacy V1 calls and 
current V1/V2 negotiation as applicable.
   - Passed all 35 tests in the metadata API module.
   - Passed `spotless:check` for both changed modules and `git diff --check`.
   
   Test commands (after installing reactor dependencies):
   
   ```sh
   mvn -B -ntp -pl dubbo-config/dubbo-config-api test 
-Dtest=MetadataServiceProtocolTest,MetadataServiceURLParamsMetadataCustomizerTest
 -DenableEmbeddedZookeeper=false -Dspotless.skip=true
   mvn -B -ntp -pl dubbo-metadata/dubbo-metadata-api test 
-DenableEmbeddedZookeeper=false -Dspotless.skip=true
   ```
   
   ## Checklist
   
   - [x] Make sure there is a 
[GitHub_issue](https://github.com/apache/dubbo/issues/15641) field for the 
change.
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction.
   - [ ] Make sure GitHub Actions can pass.
   


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