cloudbase-ai opened a new pull request, #7888: URL: https://github.com/apache/shenyu/pull/7888
URI registration can create an automatic LOCAL discovery before the client's Zookeeper/Nacos configuration arrives. Admin then reuses the LOCAL handler without rebinding it, so the configured discovery never owns the selector. Concurrent URI writers can also create duplicate handler/relation rows. Fixes #5839. - Serialize the complete URI registration and its retries with the same selector row lock used by configured discovery. Keep a consistent selector→plugin lock order for shared remote discovery creation; unrelated selectors do not hold a shared plugin lock during URI health checks. Use explicit current reads for handler/discovery state under MySQL repeatable-read transactions. - Promote only the automatically generated LOCAL fallback: preserve the handler/relation identity, apply configured properties/listener, clear the old LOCAL upstreams and committed runtime cache even for an empty remote registry, and remove the fallback discovery when unreferenced. Preserve established remote/manual bindings, and skip local URI handle/upstream mutations once remote discovery owns the selector. - Publish the URI discovery event after commit. Use a transaction template around the actual implementation so the existing fallback/retry self-invocation path has the same atomic behavior. Validation: - Two regression tests failed before the fix: configured discovery did not rebind the LOCAL handler, and local registration returned a remote handler. - JDK 17 Admin/dependency `verify`: 2,865 tests, 0 failures, 0 errors, 6 skipped; Checkstyle and RAT passed. - Real ZooKeeper integration suite: 7 cases passed on H2, MySQL 8.0 ARM64 and PostgreSQL 15 amd64. Each native run initialized the actual shipped schema and used the real Spring/MyBatis services/drivers. Cases cover URI-first/config-first arrival, concurrent writers, rollback, independent selectors under a held selector lock, empty-registry takeover, and the existing Admin HTTP registration/registry-watch/WebSocket flow. - Unit coverage also verifies existing remote bindings, namespace rejection and commit-only publication. Independent final diff review found no definite functional defect. The registration tests disable independent periodic HTTP health checking to isolate registration ordering; #7881 tracks that separate health-cache path. No two-Admin deployment or full Bootstrap request E2E is claimed. Existing duplicate relations are not automatically merged. No schema migration or dependency change is required; Oracle/OceanBase/openGauss registration integration was not executed locally. -- 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]
