Skip to content

fix: resolve MongoDB external scan follow-ups - #26495

Merged
XuPeng-SH merged 9 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26485
Aug 3, 2026
Merged

fix: resolve MongoDB external scan follow-ups#26495
XuPeng-SH merged 9 commits into
matrixorigin:mainfrom
iamlinjunhong:m-26485

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

Harden catalog typing, temporal conversion, and predicate pushdown. Bound scan and max_by memory work, share client dials, retire clients asynchronously, and align restore plus local E2E lifecycle behavior.

Fixes #26485

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #26485

What this PR does / why we need it:

fix: resolve MongoDB external scan follow-ups

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/XL Denotes a PR that changes [1000, 1999] lines label Jul 31, 2026

@fengttt fengttt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a bvt test? All these fixes seems do not have a real test case so how do we know this PR actually fixed anything at all?

@iamlinjunhong

Copy link
Copy Markdown
Contributor Author

@iamlinjunhong
iamlinjunhong requested a review from fengttt August 3, 2026 02:35
Harden catalog typing, temporal conversion, and predicate pushdown. Bound scan and max_by memory work, share client dials, retire clients asynchronously, and align restore plus local E2E lifecycle behavior.

Fixes matrixorigin#26485

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed exact head ae43f4a. No blocking findings.

Verified the fix as a set of system invariants rather than isolated cases:

  • MongoDB classification now requires planner-owned durable typing for v2 plus an anchored envelope; generic external metadata cannot inject the marker, while anchored v1 remains a constrained compatibility path.
  • Low-precision temporal mappings remain residual-only, BSON DateTime conversion rejects out-of-range years before MO arithmetic, and DATETIME/TIMESTAMP scale is applied consistently.
  • Decoded vector growth is admitted incrementally against the batch budget, with row-level rollback and bounded one-document deferral.
  • Per-key cold acquisition is singleflighted; ALTER/DROP generations, queue saturation, cancellation, shutdown, and remote fanout preserve bounded ownership and wakeup paths.
  • Snapshot/PITR/TS restore share the MongoDB mapping skip policy, preventing orphan table-ID mappings.
  • max_by uses incremental live/stale varlena accounting and amortized compaction instead of rescanning every group for every winner; merge, unmarshal, flush, OOM-preflight, and many-group cases are covered.

Local validation:

  • go test: mongodb, mongoscan, aggexec, plan, compile, frontend, cnservice, test/mongodb
  • go test -race: mongodb, mongoscan
  • go vet: all changed owning packages
  • max_by many-group repeated-winner benchmark: 36-38 us/op, 0 Go allocs/op on Apple M4
  • git diff --check clean

MongoDB E2E Local is green on this exact head. Broader CI jobs are still running and were not awaited.

@mergify

mergify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-03 11:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • Checks failed · in-place
  • 🚫 Left the queue2026-08-03 11:44 UTC · at 1b7b862ba052944a8b18525a9edd64d4e03dd9a1

This pull request spent 32 minutes 21 seconds in the queue, with no time running CI.

Waiting for
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of: [🛡 GitHub branch protection]
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
    • check-success = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
    • check-success = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]

Reason

The merge conditions cannot be satisfied due to failing checks

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MongoDB external scan follow-ups after #26424

5 participants