Repository navigation
fix(it): run the UI test MySQL on the shipped collation, and clean up a server that fails to start - #37142
Conversation
… fail fast after it
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ Approved🟡 Medium risk · Changing UI test boot-failure handling and MySQL collation could make later tests fail fast and expose collation-dependent differences. Stops the containerized UI test server's already-started MySQL, OpenSearch, and mock IdP containers when a launch step fails, and makes later UI test classes fail fast with the original boot error instead of launching new stacks. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| "--character-set-server=utf8mb4", | ||
| "--collation-server=utf8mb4_unicode_ci", | ||
| "--max_allowed_packet=64M"); | ||
| .withCommand("--character-set-server=utf8mb4", "--max_allowed_packet=64M"); |
There was a problem hiding this comment.
With #37141 and #37150 closed, bootstrap/sql/migrations/native/2.1.0/mysql/schemaChanges.sql lines 1095-1098 on main still compare entity_relationship / entity_extension ids with ontology_axiom_entity, which is created with an explicit COLLATE=utf8mb4_0900_ai_ci. So a MySQL whose default collation is utf8mb4_unicode_ci still fails the 2.1.0 migration, and after this change no test runs on that collation anymore.
Is utf8mb4_0900_ai_ci a stated requirement for 2.1 (then it needs an upgrade note or a preflight check), or is a migration fix still coming? Same question applies to #37143.
There was a problem hiding this comment.
utf8mb4_0900_ai_ci is already the default we ship in Docker: the Docker script, MySQL 8 and the new tables all use it. PR #37142 aligns the test with that. Our Helm openmetadata-dependencies chart creates utf8mb3 databases instead, through Bitnami's default, and those upgrade to 2.1 now that PR #37189 and PR #37190 are merged. The remaining gap is utf8mb4 with another collation, like utf8mb4_unicode_ci, which can't upgrade to 2.1. I haven't found a real customer in that state, so I'd state the supported collation in the upgrade notes, with a query to check it. We'd only build a conversion if a real one turns up.
…s' (#38443, #37142) (#38442) * fix(it): run the UI test MySQL on the shipped collation, and clean up a server that fails to start (#37142) * fix(it): stop a containerized UI test server that fails to start, and fail fast after it * fix(it): run the containerized UI test MySQL on the collation OpenMetadata ships with * style(it): apply spotless (cherry picked from commit 74b0529) * Select FQN-cleanup probe hashes in one collation on MySQL The hard-delete cleanup from #38126 probes every taggable entity table in one UNION ALL. MySQL rejects a UNION whose columns have different collations, and an install's hash columns do not share one: most are ascii_bin, the newer tables declare utf8mb4_0900_ai_ci, and query_entity.fqnHash (renamed in 1.2.0 without a collation) takes the server default. On a server whose default is not utf8mb4_0900_ai_ci, every hard delete of a taggable entity fails with "Illegal mix of collations for operation 'UNION'". On MySQL each probe now selects CONVERT(hash USING utf8mb4) COLLATE utf8mb4_bin. The WHERE clause still reads the bare column, so the lookup keeps its index. No schema change. (cherry picked from commit 4f9ccf8) * Run the FQN-cleanup probes on a real MySQL with mixed hash collations The SQL-string test cannot catch the collation error. This one starts MySQL with utf8mb4_unicode_ci as the server default and three tables on the collations an install mixes (ascii_bin, utf8mb4_0900_ai_ci, server default). The bare-column union fails with 'Illegal mix of collations'; the namesake and nested probes return the hash from every table. (cherry picked from commit 5316487) --------- Co-authored-by: Adrià Manero <adria.estivill@getcollate.io>
Issue
No issue. Found together with PR #37141, while finding why the nightly "Java UI ITs (embedded)" jobs on
mainand2.1have lost their runner every night since 10-20.Problem
When the OpenMetadata server container fails to start,
ContainerizedServer.launchthrows but leaves the MySQL and OpenSearch containers it started still running.UiTestServerremembers nothing about the failure, so the next UI test class launches a whole new stack, waits about 6 minutes, fails, and leaks that stack too.In the nightly embedded jobs, each leaked stack holds about 3 GB. After 8 or 9 test classes the 16 GiB runner node runs out of memory and the kernel kills the runner process. GitHub then reports "The self-hosted runner lost communication with the server", with no test results at all. That is what
mainand2.1have shown every night since 10-20. The server fails to start because the test MySQL runs onutf8mb4_unicode_ci, on which the 2.1.0 migration cannot finish.What this PR changes
utf8mb4_0900_ai_ci, the MySQL 8 default):ContainerizedServerno longer passes--collation-server=utf8mb4_unicode_ci.ContainerizedServer.launchstops everything it started (server, mock IdP, OpenSearch, MySQL and the network) when any start step fails, then rethrows.UiTestServer.getremembers a failed boot and rethrows it to every later caller. The first test fails with the real cause; the rest fail at once with "The UI test server failed to start earlier in this run", instead of each booting another stack.How it was tested
The nightly's embedded UI IT step, run locally (OpenSearch):
mainon autf8mb4_unicode_citest MySQL)utf8mb4_0900_ai_ci)Summary by Gitar
--collation-server=utf8mb4_unicode_ciflag, so containerized MySQL uses the collation OpenMetadata ships withThis will update automatically on new commits.