Skip to content

[fix](build) Keep Arrow 17 and 24 in shared thirdparty - #66546

Merged
Gabriel39 merged 3 commits into
apache:masterfrom
hubgeter:worktree/dual-arrow-17-24
Aug 31, 2026
Merged

[fix](build) Keep Arrow 17 and 24 in shared thirdparty#66546
Gabriel39 merged 3 commits into
apache:masterfrom
hubgeter:worktree/dual-arrow-17-24

Conversation

@hubgeter

@hubgeter hubgeter commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #66221

Problem Summary: master and branch-4.1 consume the same prebuilt thirdparty prefix. Upgrading the unversioned Arrow/Paimon stack to Arrow 24 makes unchanged branch-4.1 compile against incompatible headers and libraries. Keep Arrow 17/Paimon 17 in the legacy unversioned prefix, install Arrow 24/Paimon 24 in a versioned prefix selected by master, build and validate both source closures independently, and recover only stale stacks.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@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?

@hubgeter

hubgeter commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.78% (26078/43621)
Line Coverage 44.13% (264610/599625)
Region Coverage 39.88% (210769/528465)
Branch Coverage 41.28% (96466/233680)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.94% (32302/42536)
Line Coverage 60.78% (362000/595572)
Region Coverage 57.40% (304349/530202)
Branch Coverage 58.70% (137181/233704)

@hubgeter
hubgeter force-pushed the worktree/dual-arrow-17-24 branch from 77cf9ff to 8a5c653 Compare August 7, 2026 07:09
@hubgeter

hubgeter commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.87% (26127/43638)
Line Coverage 44.24% (265323/599777)
Region Coverage 39.95% (211130/528455)
Branch Coverage 41.39% (96798/233846)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.94% (32309/42545)
Line Coverage 60.83% (362360/595690)
Region Coverage 57.49% (304792/530133)
Branch Coverage 58.93% (137794/233834)

@hubgeter

hubgeter commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.93% (26170/43668)
Line Coverage 44.28% (265798/600202)
Region Coverage 40.00% (211526/528849)
Branch Coverage 41.43% (96966/234023)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.99% (32351/42572)
Line Coverage 60.88% (362907/596105)
Region Coverage 57.44% (304751/530523)
Branch Coverage 58.85% (137725/234009)

@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter
hubgeter force-pushed the worktree/dual-arrow-17-24 branch from c857f27 to fef0713 Compare August 24, 2026 09:22
@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot 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.

Requesting changes for three canonical build/compatibility defects, detailed inline.

Checkpoint conclusions:

  • Goal, scope, and tests: reviewed the complete 15-file dual-stack/build/ADBC change and its upstream/downstream consumers. The focused Arrow/Paimon lifecycle and third-party script checks pass; Linux/macOS/macOS-arm64 third-party builds, BE UT, compile, and automated code-review are still pending.
  • Configuration, compatibility, and lifecycle: selected-prefix state can drift from or bypass preflight; the legacy root migration is not failure-atomic; and target normalization/consumer gating is inconsistent. These are blocking compatibility and recovery defects.
  • Parallel and conditional paths: checked BE, Cloud, standalone compile-bench, tools, external/install-only prebuilts, pre-upgrade branch-4.1 consumers, clean/retry/interruption paths, macOS recovery, explicit prefixes, and reused CMake caches.
  • Tests, results, and observability: the ADBC formatted output remains consistent and the independent raw-value comparison remains intact. Missing lifecycle cases correspond to the inline findings. Failure diagnostics exist, but two paths either silently expose an ABI-mixed prefix or validate artifacts that are not consumed.
  • Concurrency, transactions, persistence, data writes, and protocol variables: no applicable runtime changes. No additional performance concern was found beyond the intentional cost of retaining both stacks. No additional user focus was supplied.

Review completion: capped/incomplete. Two valuable candidate instances surfaced in the third and final allowed round. Every currently known candidate is resolved and represented by the three deduplicated inline comments, but the round limit prevents claiming convergence.

Comment thread be/CMakeLists.txt Outdated
Comment thread thirdparty/build-thirdparty.sh Outdated
Comment thread build.sh
@hubgeter
hubgeter force-pushed the worktree/dual-arrow-17-24 branch from fef0713 to 4484046 Compare August 27, 2026 03:25
@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot 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.

Requesting changes for one current-release compatibility blocker, detailed inline.

Checkpoint conclusions:

  • Goal and proof: the PR coherently builds Arrow/Paimon 17 at the legacy root and Arrow/Paimon 24 at a versioned prefix, and master selects the versioned pair consistently. The local lifecycle harness and shell syntax checks pass, but the shared-artifact goal is not complete because the current post-backport branch-4.1 consumer still requires Arrow/Paimon 24 at the unversioned root.
  • Scope and clarity: the changes are focused on source/build/install selection, validation, cleanup, CMake imports, and the two related regression adjustments.
  • Concurrency: no runtime thread or shared runtime state is introduced. Thirdparty mutation remains sequential with the existing single-writer assumption.
  • Lifecycle and static initialization: no C++ static-initialization concern applies. For supported consumers, patch and component markers publish only after validation, interrupted cleanup leaves an invalid rather than ABI-mixed pair, and root/versioned cleanup preserves the other stack. The previously reported interrupted-root case is fixed at this head.
  • Configuration: Arrow/Paimon roots, versions, fingerprints, and Paimon enablement are build-time inputs, not dynamic runtime settings. Master preflight and CMake resolve one matched versioned pair; unsupported build.sh root overrides fail before recovery.
  • Compatibility and parallel paths: master, BE tools, benchmarks, standalone compile-bench, Cloud-only, install-only/source recovery, macOS/Linux, pre-backport branch-4.1, branch-4.0, and sibling publication paths were checked. Current branch-4.1 remains the sole incompatible consumer and is the inline blocker.
  • Conditions and errors: incomplete artifacts, stale fingerprints, unsupported roots, and unavailable install-only recovery fail with component/prefix context; no speculative runtime guard was added.
  • Tests and results: the lifecycle harness passes locally and in CI, relevant scripts pass bash -n, and Thirdparty Script Test is green. The harness covers selective recovery, interrupted migration, source isolation, cleanup ownership, Cloud-only, compile-bench, and explicit-root rejection, but omits the live current branch-4.1 validator/import contract. Linux/macOS/macOS-arm64 thirdparty builds, BE UT, compile, and automated code-review are currently pending. The ADBC formatting preserves the expected display output, while the following null-safe raw-value join still checks all five FLOAT/DOUBLE rows.
  • Observability: build/configuration diagnostics are sufficient for these offline paths; runtime logs and metrics are not applicable.
  • Transactions, persistence, data writes, FE/BE variables, memory, and nullable handling: no applicable production-path change. The regression formatting remains null-propagating and raw null/value equality is independently checked.
  • Performance: retaining a second source/build/static stack intentionally adds thirdparty build and storage cost; focused recovery rebuilds only invalid pairs, and no runtime hot path changes.
  • Other issues and user focus: the three existing inline findings appear fixed at this head and were kept as deduplication fences. No additional user-provided review focus was supplied.

Review completion: complete after two full rounds. Every changed path and identified risk received a final conclusion; all three second-round reviewers returned NO_NEW_VALUABLE_FINDINGS, and the sole accepted blocker survived independent falsification and live duplicate checks.

# distinguish this stack from unrelated thirdparty changes.

# arrow
# Arrow 24 is installed in a versioned prefix. The unversioned install prefix is

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.

[P1] Keep the current branch-4.1 consumer compatible with this layout

The live branch-4.1 already contains the Arrow 24 backport and still validates/imports Arrow/Paimon 24 from the unversioned installed root (including libarrow_compute.a); its BE-UT script refreshes the official install-only tree from this same shared automation asset. This change replaces that root with the Arrow/Paimon 17 contract and puts 24 only under installed/arrow-24.0.0. Once the asset uses this layout, the current branch rejects it and cannot recover, while a source checkout rebuilds 24 into the root and removes compatibility for the pre-upgrade revisions this change is meant to preserve. Please coordinate/land a branch-4.1 consumer change that selects the versioned 24 prefix before publishing this artifact, and cover that branch's validator/import contract in the lifecycle test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed against the live apache/branch-4.1 head aa135178aaf1. The current consumer still validates the shared automation archive at the unversioned installed root in run-be-ut.sh / thirdparty/arrow-paimon-vars.sh, and BE imports that same root via THIRDPARTY_DIR.

Therefore this P1 is valid: a master-only change cannot make one fixed unversioned path expose Arrow/Paimon 17 to pre-backport revisions and Arrow/Paimon 24 to the current branch at the same time. The dual-layout artifact must not be published until a companion branch-4.1 consumer change selects installed/arrow-24.0.0. I intentionally did not add an ABI-mixed shim or hide the rollout dependency in this PR, and I am leaving this thread unresolved until that branch change is authorized and landed.

For the code in this PR, the rebase onto current master is now at cf4a25729ff; the focused lifecycle test, shell syntax checks, and formatting checks pass. The prior-head TeamCity Compile, BE UT, and Performance builds also passed.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 65.36% (29600/45285)
Line Coverage 50.14% (318766/635770)
Region Coverage 46.06% (262277/569467)
Branch Coverage 47.15% (120767/256113)

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66221

Problem Summary: master and pre-upgrade branch-4.1 revisions consume the same prebuilt thirdparty package. Upgrading the unversioned Arrow/Paimon stack to Arrow 24 makes unchanged branch-4.1 code compile against incompatible headers and libraries. Keep Arrow 17/Paimon 17 in the legacy unversioned prefix, install Arrow 24/Paimon 24 in a versioned prefix selected by master, build and validate both source closures independently, and recover only stale stacks.

### Release note

None

### Check List (For Author)

- Test:
    - Manual test: downloaded and checksum-verified the latest Linux x86_64 thirdparty prebuilt
    - Manual test: built Arrow/Paimon 17 and Arrow/Paimon 24 thirdparty stacks
    - Manual test: ran thirdparty/test/arrow-paimon-lifecycle-test.sh
    - Manual test: completed an ASAN master BE and FE build
- Behavior changed: Yes. The shared thirdparty prefix keeps Arrow/Paimon 17 at the legacy root and installs the Arrow/Paimon 24 stack selected by master under a versioned directory.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66221

Problem Summary: Arrow 24 preserves DBL_MAX as a finite 17-digit value, while the existing ADBC regression baseline is intentionally rendered with 16 significant digits. Passing the 17-digit text through the test client can reparse it above DBL_MAX as infinity. Explicitly format the displayed DOUBLE column to 16 significant digits while retaining the existing bit-for-bit value comparison inside Doris.

### Release note

None

### Check List (For Author)

- Test:
    - Manual test: verified format("{:.16g}", value) output for every non-null DOUBLE fixture value
    - Manual test: git diff --check for this commit
- Behavior changed: No. This only stabilizes an existing external regression baseline.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66221

Problem Summary: Review found that reused CMake caches could retain stale automatic Arrow/Paimon prefixes, build.sh validated the shared default even when CMake selected another pair, an interrupted root-prefix Arrow 17 migration could expose Paimon built against Arrow 24, and target normalization incorrectly gated Cloud-only and standalone compile-bench builds. Refresh CMake selections on every configure, reject unsupported build.sh prefix overrides before recovery, remove Paimon before downgrading the legacy Arrow prefix, and normalize dependency consumers before preflight. The PR no longer modifies the macOS BE workflow because upstream intentionally removed PR triggers and the existing thirdparty workflow already validates both macOS builds.

### Release note

None

### Check List (For Author)

- Test:
    - Manual test: bash -n for the modified build and lifecycle scripts
    - Manual test: thirdparty/test/arrow-paimon-lifecycle-test.sh
    - Manual test: git diff --cached --check
- Behavior changed: Yes. Cloud-only builds skip unused Arrow/Paimon validation, standalone compile-bench performs BE preflight, unsupported explicit build.sh prefixes fail clearly, and interrupted Arrow 17 migration removes ABI-incompatible Paimon artifacts first.
- Does this need documentation: No
@hubgeter
hubgeter force-pushed the worktree/dual-arrow-17-24 branch from 4484046 to cf4a257 Compare August 28, 2026 03:44
@hubgeter

Copy link
Copy Markdown
Contributor Author

run buildall

@hubgeter

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Your access token could not be refreshed because your refresh token was revoked. Please log out and sign in again.
Workflow run: https://github.com/apache/doris/actions/runs/33139915930

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@shuke987

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot 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.

Reviewed the full authoritative diff at cf4a25729ff27e70b6b788dc0587ba488bcf54c4. I am requesting changes for two newly introduced issues below; the separate unresolved branch-4.1 artifact-first P1 remains valid.

Checkpoint conclusions:

  • Goal and normal paths: the dual source/install layout, Arrow 17 historical patches, Arrow 17/24 archive differences, matched CMake imports, and ADBC semantic assertion are internally consistent outside the findings below.
  • Compatibility and rollout: the current official root-only install artifact is incompatible with the new mandatory versioned master consumer (P1). Existing review threads fence the inverse branch-4.1 ordering problem and direct split-prefix path.
  • Failure handling and lifecycle: source alias extraction, marker invalidation, legacy-root cleanup, and cross-stack ownership are fail-closed for newly introduced paths. Two additional traces were reproduced but dismissed because the same behavior exists at the base revision.
  • Performance: Paimon-only legacy invalidation unnecessarily repeats the newly added Arrow 17 build (P2).
  • Tests: the focused lifecycle harness and shell syntax checks pass; both macOS thirdparty CI legs and script checks pass. The harness does not cover the immediately previous official archive or the Paimon-only legacy selector case. Linux thirdparty, BE UT, and compile checks were still pending during the final sweep.
  • Concurrency, runtime resource lifetime, configuration/state mutation, transactions, persistence, and data writes: no additional applicable regression was found in this build-only change.
  • User focus: no additional focus was supplied.

@github-actions github-actions Bot 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.

Corrected inline-anchor resubmission for review 5048665318. The two findings and the CHANGES_REQUESTED conclusion are unchanged; the original misplaced inline comments were deleted after PR-scoped API verification.

Comment thread build.sh
fi

if [[ "${NEED_ARROW_PAIMON_THIRDPARTY}" == "true" ]]; then
DEFAULT_ARROW_PAIMON_HOME="${DORIS_THIRDPARTY}/installed/${ARROW_INSTALL_SUBDIR}"

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.

[P1] Keep the previous official prebuilt usable during rollout

This makes installed/arrow-24.0.0 mandatory, but the current automation archive is stamped 1731787677f0 and contains Arrow/Paimon 24 only at the unversioned root. Official compilation images expose only that installed tree as DORIS_THIRDPARTY, so a default build on the new master reaches rebuild_thirdparty_libraries() and exits because the install-only prefix has no build-thirdparty.sh. Publishing the dual layout first is not safe either: it replaces root 24 with 17 for live pre-merge master and the current branch-4.1 consumer (the latter is the existing unresolved thread); the manual arbitrary-ref workflow still clobbers this same shared release. Please add a transitional, fingerprint/version-validated root-24 fallback that prefers the versioned prefix, or stage a consumer/artifact rollout with no mismatched window, and cover the immediately previous official archive in the lifecycle test.

local install_dir="$1"
ARROW_PAIMON_REBUILD_PACKAGES=()

if ! arrow_paimon_17_prebuilt_valid "${install_dir}"; then

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.

[P2] Do not rebuild valid Arrow 17 for a Paimon-only change

This composite check appends arrow_17 paimon_cpp_17 even when arrow_17_prebuilt_valid succeeds and only the Paimon 17 marker/input is stale. For example, a Paimon-only cache change or retry after paimon_cpp_17 fails leaves Arrow 17 valid, yet the new selector repeats that large build; a fixture with valid Arrow and invalid Paimon markers selects all four packages. The patch already publishes independent component fingerprints, and build_paimon_cpp_17() validates/reuses Arrow through require_arrow_17_prebuilt_for_paimon(), so select only paimon_cpp_17 in this case and add the component-only recovery case to the lifecycle test.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 62.71% (29334/46780)
Line Coverage 47.69% (306857/643425)
Region Coverage 43.34% (247924/572095)
Branch Coverage 44.90% (115396/257032)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.94% (34407/45308)
Line Coverage 60.90% (387392/636062)
Region Coverage 56.97% (324692/569912)
Branch Coverage 57.85% (148269/256299)

@Gabriel39
Gabriel39 merged commit e5f6299 into apache:master Aug 31, 2026
33 checks passed
hubgeter added a commit to hubgeter/doris that referenced this pull request Aug 31, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66546

Problem Summary: The branch-4.1 BE UT job can consume the master automation prebuilt, whose unversioned Arrow/Paimon stack no longer satisfies the shared Arrow 17/24 layout. The download path also certified only the versioned stack, library stripping assumed lib was a symlink, and record batch readers ended early for a leading empty row group. Rebuild missing stacks in a source checkout, validate both stacks before reuse or replacement, strip explicit library directories, and skip empty row groups before reading the next batch.

### Release note

None

### Check List (For Author)

- Test: Unit Test / Manual test
    - `./thirdparty/test/arrow-paimon-lifecycle-test.sh`
    - Arrow 17 and Arrow 24 `GetRecordBatchReaderSkipsEmptyLeadingRowGroup` tests
    - `./thirdparty/build-thirdparty.sh -j 8 arrow_17 paimon_cpp_17 arrow paimon_cpp`
    - `./build-support/check-format.sh`
    - Shell syntax and `git diff --check`
- Behavior changed: Yes. Shared prebuilt reuse now requires both Arrow/Paimon stacks, and empty row groups no longer terminate the patched reader early.
- Does this need documentation: No
hubgeter added a commit to hubgeter/doris that referenced this pull request Aug 31, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#66546

Problem Summary: Shared Arrow/Paimon recovery could validate the default tree while BE UT consumed independently overridden ABI roots, Paimon installation depended on the platform default libdir, Arrow empty-row-group skipping left Paimon on a zero-width logical range, and archive validation accepted incomplete SDK artifacts. Select one versioned build home for all BE entrypoints, fix Paimon installation at lib64, synchronize its row-group ranges with Arrow, and validate consumed headers plus nonempty static archives before publishing or installing a prebuilt.

### Release note

None

### Check List (For Author)

- Test: Unit Test / Manual test
    - `./thirdparty/test/arrow-paimon-lifecycle-test.sh`
    - `./thirdparty/build-thirdparty.sh -j 8 arrow_17 paimon_cpp_17 arrow paimon_cpp`
    - `./thirdparty/build-thirdparty.sh -j 8 paimon_cpp_17 paimon_cpp`
    - Arrow 17 and Arrow 24 Paimon empty-row-group smoke tests with production static libraries
    - Paimon `file_reader_wrapper_test.cpp` compilation against Arrow 17 and Arrow 24
    - `./build-support/check-format.sh`
    - Shell syntax and `git diff --check`
- Behavior changed: Yes. BE build entrypoints enforce one ABI pair, shared prebuilts require consumable SDK artifacts, and Paimon skips zero-width row-group ranges.
- Does this need documentation: No
Gabriel39 pushed a commit that referenced this pull request Sep 1, 2026
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.

4 participants