Gabriel39 opened a new pull request, #70456: URL: https://github.com/apache/doris/pull/70456
### Background The native MongoDB catalog uses the shared external-table discovery cache and a native single-cursor reader. A cold table lookup first enumerates names from the source. The MongoDB roadmap tracks minimal collection, view and time-series reads in M0. ### What problem does this PR solve? Issue Number: #70251 Related PR: #70327 (native reader/catalog implementation), #70249 (dependencies) PR Type: Bugfix Problem Summary: An incorrect MongoDB password or a TLS hostname failure currently reaches SQL as a missing-table error because the shared existence check discards the connector exception. Preserve the typed source error and its retry behavior. Also close M0 acceptance gaps: the 2,081-row fixture fits inside the current default batch size, so existing batch tests do not necessarily issue getMore. ### Details - **Change map:** 4 production additions; 352 test additions/5 deletions; 21 generated result lines; 36 documentation additions/1 deletion. Most of the diff is an opt-in real-driver fault runner, SQL acceptance coverage, and its instructions. - **Frequency:** Deterministic on a cold lookup when connector metadata enumeration fails, reproduced with invalid credentials and TLS hostname validation failure. - **Root cause:** ExternalDatabase treats runtime failures during the names/existence lookup as evidence that the table is absent. - **Why existing tests missed it:** Native SQL coverage lacked invalid-credential recovery. The multi-batch fixture has 2,081 rows while the default batch size is 8,160; getMore and early cursor closure were insufficiently exercised. - **Fix:** Rethrow DorisConnectorException from the shared lookup. Explicit batch-size hints force the existing boundary tests across source batches. Add credential correction, unsupported-mode rejection, view residual semantics, internal-table materialization/differential checks, and an environment-configured fault runner that verifies source cursors and successful reads after errors, timeouts and cancellation. - **Other paths and branches:** The exception fix applies to Connector SPI catalogs through the shared discovery path. No connector-specific branch, configuration default, IDL, or storage format is added. This PR targets master. - **Behavior change:** Authentication/transport failures remain source failures; a successful lookup that finds no matching table retains missing-table behavior. ### Testing Completed locally on Linux x86_64 with MongoDB 8.0.20, Java driver 5.14.0 and C driver 2.5.8: - Complete clean FE and ASAN BE build through build.sh --clean --be --fe. - FE Checkstyle: zero violations, including a separate fe-core check. - New discovery unit test failed before the fix because no exception was thrown. After the fix, all 51 ExternalCatalogTest tests passed; all 31 native MongoDB connector tests also passed. - Selected BSON SerDe/native reader unit tests through run-be-ut.sh: 44 passed. - Both native SQL suites: generated the new expected output with the normal runner, then independently compared both suites: 2 passed, 0 failed/fatal/skipped. The internal-table differential is zero across 2,081 fixture rows. - Final opt-in lifecycle runner passed EOF/LIMIT/decode-error cleanup, injected getMore failure, socket and query deadlines, cancellation after a blocked getMore was observed, concurrent reads, and subsequent recovery. Source open cursors returned to zero after each scenario. The query deadline case uses a socket timeout longer than the injected delay, so a socket timeout cannot mask a missing query deadline. - Trusted-CA TLS reads passed. Untrusted certificates and hostname mismatches were rejected with source errors. Snappy, zlib and zstd multi-batch reads passed; MongoDB client metadata confirmed negotiation for both drivers. SCRAM-SHA-256 and URI-escaped SCRAM-SHA-1 credentials passed. - Python Ruff checks and formatting passed. Full diff/self-review and private-context scan completed. Generated output retains the regression runner's canonical blank-line separators. ### Notes for Reviewers The fault runner requires an otherwise idle, disposable, test-command-enabled MongoDB fixture and explicit environment-injected connection settings; ordinary external regression does not enable failpoints. Its invocation is documented next to the fixture. The SQL suites remain gated by enableMongoDBTest. This is M0 single-cursor acceptance for the tested matrix. MongoDB 7, broader replica-set/mongos/SRV and architecture qualification, rolling upgrades, performance and release soak work remain tracked in #70251. ### Release note Preserve connector metadata authentication and transport errors during cold external-table lookups instead of reporting a missing table. ### Check List (For Author) - Behavior changed: Yes (see Details). - Does this need documentation: No user-facing configuration change; fixture and fault-test instructions are included. - Pre-submission status: Ready; local validation above completed, PR CI pending. ### AI Disclosure - Tool: Codex (GPT-6). - Generated: fix, tests, fixture instructions, and this description. - Human review: Pending maintainer review. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
