Skip to content

[v4.2.1-hotfix] fix: skip folder markers during ETL merge - #27777

Merged
XuPeng-SH merged 1 commit into
v4.2.1-hotfixfrom
backport/27748-to-v4.2.1-hotfix
Aug 28, 2026
Merged

XuPeng-SH merged 1 commit into
v4.2.1-hotfixfrom
backport/27748-to-v4.2.1-hotfix

Conversation

@LeftHandCold

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #27740

What this PR does / why we need it:

Cherry-picks the focused fix from #27748 onto v4.2.1-hotfix.

S3-compatible object stores can expose zero-byte folder marker objects while ETL merge scans a log directory. The merge task previously treated every listed entry as a data file, allowing an unsupported marker path to reach newETLReader and panic the CN.

This backport:

  • skips directory and unsupported entries before adding them to an ETL merge batch;
  • dispatches readers by the exact final .csv or .tae extension;
  • returns ErrNotSupported instead of panicking if an unsupported path reaches newETLReader;
  • includes the deterministic regression coverage from [4.2] fix: skip folder markers during ETL merge #27748.

Backport scope:

  • target base: v4.2.1-hotfix at d2393868a7aaa6343518d80849fe4696aa3577e9;
  • source commit: 3b265f1ddcc62cacafa0ab695feeb2e35ab6711f;
  • stable patch-id matches the source commit;
  • only pkg/util/export/merge.go and pkg/util/export/merge_test.go change; the unrelated FULLTEXT2 commit from 4.2-dev is not included.

Validation:

  • focused CGo-controlled selection and execution passed for TestMergeMainSkipsNonETLEntries, TestIsETLFile, and Test_newETLReader;
  • full CGo-controlled ./pkg/util/export package test passed;
  • git diff --check passed;
  • source PR [4.2] fix: skip folder markers during ETL merge #27748 completed its required CI successfully.

BVT is not applicable because this changes only the internal ETL background file-selection contract and has no SQL-visible behavior.

Filter directory and unsupported entries before ETL merge processing, and return a normal error instead of panicking when an unsupported path reaches the reader. Add regression coverage for object-store folder markers and supported extension controls.

(cherry picked from commit 25f2851)
(cherry picked from commit 3b265f1)
@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 →

@mergify
mergify Bot requested a review from XuPeng-SH August 28, 2026 03:45
@mergify mergify Bot added the kind/bug Something isn't working label Aug 28, 2026
@XuPeng-SH
XuPeng-SH merged commit 9bf92dc into v4.2.1-hotfix Aug 28, 2026
10 checks passed
@XuPeng-SH
XuPeng-SH deleted the backport/27748-to-v4.2.1-hotfix branch August 28, 2026 03:53
XuPeng-SH added a commit that referenced this pull request Nov 2, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Related to #27740 and #28943.

## What this PR does / why we need it:

Backport two existing fixes to `release/v4.2.1-hotfix-20261026`, in
their original order:

- `9bf92dc56b` (#27777): skip directory markers and unsupported entries
during ETL merge; return an error instead of panicking on unsupported
reader paths.
- `115c227239` (#28945): rank multi-CN IVF candidates by distance before
applying the global candidate limit, preserving better candidates from
later streams.

Both cherry-picks apply without conflicts and retain identical patch
IDs. Only the original four files change.

Validation on this release base: full export, compile, Top and MergeTop
package tests in normal and race modes; IVF planner
direction/pagination/INCLUDE controls; incremental lint, vet and
formatting. Existing multi-CN IVF BVT: 26/26 statements pass twice on
one local two-CN cluster, with schema cleanup checked after each run.

IVF global ranking consumes all emitted partition candidates and adds
sorting work. The source PR reported about 27% higher median latency on
one historical million-row fixture; that benchmark was not rerun here.
The local BVT is a topology smoke test; deterministic competing-stream
ordering is covered by generated-operator tests. CI is pending.

---------

Co-authored-by: GreatRiver <[email protected]>
Co-authored-by: aptend <[email protected]>
Co-authored-by: iamlinjunhong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants