Skip to content

[4.2] fix: skip folder markers during ETL merge - #27748

Merged
XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
aptend:backport/27740-to-4.2-dev
Aug 27, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
aptend:backport/27740-to-4.2-dev

Conversation

@aptend

@aptend aptend commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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:

Backport of #27747 to 4.2-dev.

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, so a marker without a .csv or .tae extension
reached newETLReader and panicked the CN.

This change:

  • filters directory and unsupported entries before adding them to an ETL merge
    batch;
  • dispatches readers by the exact final file extension;
  • returns ErrNotSupported instead of panicking if an unsupported path reaches
    newETLReader;
  • adds deterministic regression coverage for zero-byte marker objects,
    directory entries, supported ETL files, and misleading suffixes.

The source patch applies cleanly to the latest 4.2-dev, and its stable
patch-id matches #27747.

Validation on 4.2-dev:

  • focused TestMergeMainSkipsNonETLEntries, TestIsETLFile, and
    Test_newETLReader tests passed with non-empty selection;
  • full ./pkg/util/export package tests passed;
  • molint passed for ./pkg/util/export;
  • golangci-lint -c .golangci.yml ./pkg/util/export passed with 0 issues.

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)
@aptend
aptend requested a review from gouhongshen as a code owner August 27, 2026 08:10
@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 →

@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 review completed and approved. This is a clean 4.2-dev backport of the existing ETL merge fix: minimal one-commit change limited to pkg/util/export/merge.go and merge_test.go, same stable patch-id as the source branch and no branch-drift observed. I did not identify correctness, lifecycle, performance, or risk regressions; unhappy-path handling improved by skipping non-ETL entries and returning typed errors instead of panics.

@XuPeng-SH
XuPeng-SH merged commit 602c4dd into matrixorigin:4.2-dev Aug 27, 2026
25 checks passed
XuPeng-SH pushed a commit that referenced this pull request Aug 28, 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:

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 #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 #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.

Co-authored-by: aptend <[email protected]>

This branch was previously deployed

1 inactive deployment
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 size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants