Skip to content

fix: skip folder markers during ETL merge - #27747

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
aptend:fix/27740-etl-merge-marker
Aug 27, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
aptend:fix/27740-etl-merge-marker

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:

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.

Validation:

  • 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.
@aptend
aptend requested a review from gouhongshen as a code owner August 27, 2026 07:42
@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: APPROVE.

Root cause matches issue #27740: S3/MinIO folder markers can be exposed as non-directory entries with an empty name, which previously reached newETLReader and panicked. The IsDir + exact .csv/.tae filtering closes the production path, and newETLReader now returns ErrNotSupported instead of panicking as defense in depth. No correctness, lifecycle/unhappy-path, compatibility, or material performance regression found.

Validation on PR head 12a39fc: focused regression tests passed; full ./pkg/util/export passed (15.443s); git diff --check passed.

XuPeng-SH pushed a commit that referenced this pull request Aug 27, 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:

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.
@XuPeng-SH
XuPeng-SH merged commit 662c1bd into matrixorigin:main Aug 27, 2026
1 check passed
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 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 matrixorigin#27740

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

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.

Validation:

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 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 matrixorigin#27740

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

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.

Validation:

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 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 matrixorigin#27740

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

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.

Validation:

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[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