Skip to content

[refactor] Catalog spi 413 upgrade compat ut - #66214

Open
morningman wants to merge 4 commits into
apache:branch-catalog-spifrom
morningman:catalog-spi-413-upgrade-compat-ut
Open

[refactor] Catalog spi 413 upgrade compat ut#66214
morningman wants to merge 4 commits into
apache:branch-catalog-spifrom
morningman:catalog-spi-413-upgrade-compat-ut

Conversation

@morningman

Copy link
Copy Markdown
Contributor

No description provided.

@morningman
morningman requested a review from CalvinKirs as a code owner July 29, 2026 06:06
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

morningman and others added 2 commits July 29, 2026 21:22
…ing replay

Replaying OP_CREATE_CATALOG builds the connector synchronously, on the thread
that is starting the FE, and EditLog's fallback turns anything thrown there
into System.exit(-1). So a connector that rejects a property an older FE
stored without validating -- or a half-installed plugin throwing
NoClassDefFoundError -- keeps the whole FE from starting instead of making one
catalog unusable. The image path never had this problem because it builds the
connector lazily.

Catch on the replay arm only and fall through to the degraded registration
that already exists for an unclaimed type; the failure resurfaces at first
access as an ordinary query error. Interactive CREATE CATALOG still fails
loud, because the user is waiting for the error.

Catching RuntimeException | Error rather than Exception is deliberate: a
half-installed plugin throws NoClassDefFoundError, not a RuntimeException.

Covered by Legacy413JournalReplayTest#connectorConstructorThatThrowsMustNotTakeTheFeDown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…mework

Adds golden FE metadata fixtures produced by real Doris 4.1.3 bytecode, and
the tests that replay them on this branch. Goal: a catalog created on 4.1.3
must migrate onto the connector SPI and remain usable, through both the image
and the edit-log path.

The fixtures are generated, never hand-written. 4.1.3's wire format has at
least five details a hand-authored blob gets wrong: HTML escaping is on
(jdbc_url persists '=' and '&' escaped), serializeNulls is off (the resource
key vanishes when null), taap is polymorphic ({} when empty, an array of
2-tuples when not), clazz is written first, and the create path rewrites the
property map before it is persisted. The generator, its provenance and the
regeneration recipe live next to the fixtures; output is byte-deterministic.

Fixture families, and why the resource-backed one is not optional: with a
"type" property present, deleting the migration entirely leaves every
assertion green, because getType() just reads what was already on the wire.
Only the resource-backed catalogs -- which persist no "type" and recover it
from logType -- can fail when the migration is removed. Mutation-verified.

Tests:
  Legacy413ImageMigrationTest       all 20 legacy catalog labels migrate;
                                    engine-owned types (doris) do not; type
                                    recovery incl. the trino-connector hyphen;
                                    comment/lastUpdateTime/taap/jdbc_url fidelity
  Legacy413LabelRegistryTest        every label 4.1.3 could write still resolves,
                                    compared registry-to-registry rather than
                                    against a hand-maintained list
  Legacy413JournalReplayTest        edit-log replay, property fidelity through to
                                    the connector, degraded paths
  Legacy413CloudImageTest           cloud mode; one guard, not a second matrix,
                                    because the cloud and non-cloud modules differ
                                    in exactly one entry
  Legacy413ProviderTypeContractTest the recovered type must be a string a REAL
                                    shipped provider answers to -- the two halves
                                    are literals in different modules

fe-core gains test-scope-only dependencies on the connector modules, matching
the existing fe-filesystem-* arrangement, solely so that last test can compare
both halves. Production still loads connectors from plugins/connector/.

Anti-vacuity: five mutations were applied and each turned the predicted test
red -- disabling the type backfill, dropping the TRINO_CONNECTOR case,
deleting a GSON label, reverting the replay guard, and removing a connector
from the shipped set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@morningman
morningman force-pushed the catalog-spi-413-upgrade-compat-ut branch from 790206f to 95b7435 Compare July 29, 2026 13:22
morningman and others added 2 commits July 30, 2026 00:50
…vn test` can compile against them

fe-connector-hms-hive-shade and fe-connector-paimon-hive-shade carry no
sources: their Hive metastore content exists only once maven-shade has run.
With both maven-jar-plugin and maven-shade-plugin bound to `package`, any
build that stops earlier leaves those modules with nothing but an (empty)
target/classes, and that is what the reactor then hands to their consumers.

run-fe-ut.sh builds with `mvn test`, which stops before `package`. Once
fe-core took test-scope dependencies on the connector impl modules, the FE UT
reactor grew from 40 to 59 modules and began pulling fe-connector-hms in,
where every org.apache.hadoop.hive.* import failed to resolve (TeamCity FE UT
1009434: "package org.apache.hadoop.hive.metastore.api does not exist", build
aborted before fe-core ran a single test). fe-connector-paimon would have
failed the same way on HiveConf one module later.

Move both executions to process-classes -- the last phase still ahead of
test-compile -- keeping maven-jar-plugin declared first so the main artifact
is present before shade, which is what the package-phase pin was protecting
under a parallel reactor. Cost is ~21s per FE UT run (paimon 17s, hms 4s),
since the build cache is disabled at project level for both modules.

Verified: the full 59-module `mvn -pl fe-common,fe-core -am test-compile`
succeeds and reproducibly fails on fe-connector-hms without this change; both
shade jars rebuild identical to the previous ones (same byte size, same 7940
/ 55313 entry listings); `package` still runs each shade exactly once and the
hive / paimon / iceberg / hudi plugin zips each carry their shade jar.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JZp6xJNzwavabuea7bsAP
…-classes)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JZp6xJNzwavabuea7bsAP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants