cloudbase-ai opened a new pull request, #7885: URL: https://github.com/apache/shenyu/pull/7885
Concurrent Admin writers can both observe an absent instance and insert different IDs for the same namespace/IP/port/type. This change enforces that identity in the database, recovers a losing insert by updating the canonical row, and guards updates so an older heartbeat cannot overwrite a newer observation. Equal heartbeat timestamps still permit liveness state transitions. Fixes #7733. - Add full-length identity uniqueness to fresh MySQL/OceanBase, PostgreSQL/openGauss, Oracle and H2 schemas. The 2.7.2→2.7.3 migrations retain the complete row with greatest heartbeat, then update/create timestamps, then ID before creating the index. Include an explicit persistent-H2 upgrade. - Suspend caller transactions during diagnostic writes so PostgreSQL duplicate-insert recovery can use a fresh, usable statement transaction. Preserve canonical IDs and creation timestamps. - Add a barrier-controlled H2 regression with two independent real SQL writers, both insertion orders, stale/zero/equal/newer reports, namespace isolation, caller rollback and legacy migration coverage. Extend the existing native SQL CI matrix with deduplication, full key lengths, distinct identity components, actual duplicate rejection and production mapper update SQL. Validation: - Before the fix, both concurrent interleavings retained two rows; the stale update replaced heartbeat 200 with 100. - JDK 17 `./mvnw -B -pl shenyu-admin -am verify -Djacoco.skip=true -Dmaven.javadoc.skip=true`: 2,860 tests, 0 failures/errors, 6 skipped; Checkstyle and RAT passed. - Offline native-matrix harness: 32 tests passed. - Complete native upgrade and fresh-install flows passed on PostgreSQL 15 (amd64) and MySQL 8.0 (arm64, using the same pinned multi-architecture digest). Oracle, OceanBase and openGauss checks are still running locally; all five amd64 CI jobs remain required. Native checks execute SQL, while the Java concurrency/service tests use H2. Upgrade notes: stop all Admin writers and back up `instance_info` before applying the one-time migration, then start the updated Admin. The full utf8mb4 key can require 1,736 bytes; MySQL installations with the legacy 767-byte InnoDB index limit must enable the modern large-prefix/DYNAMIC format or upgrade. Heartbeat ordering uses reported timestamps and does not establish a global clock or resolve simultaneous state ties. See `db/upgrade/upgrade-guide.md`. -- 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]
