zmuxuny opened a new issue, #6022: URL: https://github.com/apache/rocketmq-dashboard/issues/6022
### Before Creating the Bug Report - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate. - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository. - [x] I can reproduce this on the current `master` branch, or I have stated the exact version I am running below. ### Studio Version `rocketmq-studio` at `a460673fb5b1c61b06f06bac5e48428bb479fa07`, built from source. The affected migration and test were introduced by #5006. ### Runtime Environment Linux, embedded H2 2.4.240 in MySQL compatibility mode. This report concerns the embedded database concurrency path. It does not claim the same failure on MySQL. ### Connected RocketMQ Cluster None needed. The failing migration test uses the local schema and a mocked cluster resolver. ### Build Toolchain Temurin Java 21, Maven 3.9.11. GitHub CI also reproduces on Java 21. ### Describe the Bug ## Tracking continuation (2026-10-10) This replaces #5302, which was automatically closed by github-actions[bot] for inactivity on 2026-10-09. The issue's technical/design scope is preserved. Its current discussion and related issue/PR searches were rechecked before creating this continuation; no existing replacement issue was found. The H2 version override remains a proposal awaiting maintainer agreement. No dependency upgrade approval or implementation PR is claimed. The diagnostics below are the original dated observations, not a fresh run against today's branch. The original report below retains its stated baseline and historical verification. It does not claim fresh test results, fully green CI, or new maintainer approval. Discussion and prior evidence remain available in #5302. `ResourceOwnershipGuardTest.migrationConcurrentStartupIsIdempotentTest` intermittently fails while two `ResourceOwnershipSchemaMigration` instances perform index DDL and inspect JDBC metadata on the same H2 database. This fails the backend CI job on otherwise unrelated PRs. One exact [CI example](https://github.com/apache/rocketmq-dashboard/actions/runs/36882871163/job/110438766492) reports: ```text JdbcSQLNonTransientException: General error: "java.util.ConcurrentModificationException" [50000-240] at JdbcDatabaseMetaData.getIndexInfo at ResourceOwnershipSchemaMigration.indexes:140 at ResourceOwnershipSchemaMigration.ensureIndex:119 at ResourceOwnershipSchemaMigration.afterPropertiesSet:99 Caused by: java.util.ConcurrentModificationException at ArrayList$Itr.next at DatabaseMetaLocal.getIndexInfo:1229 ``` H2 2.4.240 iterates the table's mutable `ArrayList` of indexes while the other connection changes that list. A standalone two-connection JDBC program reading `getIndexInfo` while creating/dropping an index reproduces the same stack without any Studio code. ### Steps to Reproduce 1. Check out `a460673fb5b1c61b06f06bac5e48428bb479fa07`. 2. Run `cd server && mvn -B -ntp -Dtest=ResourceOwnershipGuardTest#migrationConcurrentStartupIsIdempotentTest test`. A single invocation may pass because this is a race. 3. Exercise the same existing test repeatedly with a fresh schema each time. In a local 100-run diagnostic, the unmodified test failed 15 times: 13 `ConcurrentModificationException` failures and 2 H2 internal index-creation errors. 4. Run the identical diagnostic with only the runtime H2 JAR changed to 2.5.252: **100/100 passed**. These are observations of a bounded stress run, not proof that every schedule is safe. ### What Did You Expect to See? Both startup migrations finish successfully; the existing ownership conflict assertions still hold. No duplicate ownership data is silently accepted or discarded. ### What Did You See Instead? An internal H2 exception aborts one migration and fails the test/CI job. ### Additional Context H2 changed the table index collection to `CopyOnWriteArrayList` in [ce651ab](https://github.com/h2database/h2database/commit/ce651ab35936a7943623c222655fd4ddb1f4aa99). The change is included in the released [2.5.252 artifact](https://github.com/h2database/h2database/releases/tag/version-2.5.252); its [tagged MVTable source](https://github.com/h2database/h2database/blob/version-2.5.252/h2/src/main/org/h2/mvstore/db/MVTable.java) uses the new collection. The related upstream report is [H2 #4398](https://github.com/h2database/h2database/issues/4398). Without changing Studio source or tests, the following six directly H2-backed classes passed with `-Dh2.version=2.5.252`: `ResourceOwnershipGuardTest`, `QueryHistorySchemaMigrationTest`, `QueryHistorySchemaIndexTest`, `CloudCredentialSchemaMigrationTest`, `AlertSchemaMigrationTest`, and `AiConversationSchemaMigrationTest`: **46 tests passed**, zero failures/errors/skips. Five additional explicit dev/H2 integration classes also passed: `AiConversationPersistenceIntegrationTest`, `AuthCookieProfileTest`, `AuthPasswordChangeStatusIntegrationTest`, `AuthServicePasswordChangeIntegrationTest`, and `DemoDataSqlCompatibilityTest`: **16 tests passed**. Total: **11 classes / 62 tests**, with zero Checkstyle violations. Would maintainers accept a focused H2 version override to the fixed release, with the existing concurrent test and ownership checks retained? `CONTRIBUTING.md` asks for agreement before dependency upgrades, so this raises that decision first. No retries, skipped tests, relaxed assertions, application-locking workaround, or dependency change has been submitted. Full backend-suite and packaging verification would still be needed before a PR could be considered ready. Duplicate check: searched open/recent issues and PRs for the exact test name, `ResourceOwnershipSchemaMigration`, `ConcurrentModificationException`, and H2 upgrades; no dedicated fix was found. Existing H2 snapshot-column work addresses a different issue. AI assistance was used to investigate and verify the source and diagnostic results. ### Are You Willing to Submit a Pull Request? - [x] Yes, I am willing to submit a pull request. -- 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]
