Repository navigation
[4.2] fix: skip folder markers during ETL merge - #27748
Conversation
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)
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
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.
## 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]>
What type of PR is this?
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
.csvor.taeextensionreached
newETLReaderand panicked the CN.This change:
batch;
ErrNotSupportedinstead of panicking if an unsupported path reachesnewETLReader;directory entries, supported ETL files, and misleading suffixes.
The source patch applies cleanly to the latest
4.2-dev, and its stablepatch-id matches #27747.
Validation on
4.2-dev:TestMergeMainSkipsNonETLEntries,TestIsETLFile, andTest_newETLReadertests passed with non-empty selection;./pkg/util/exportpackage tests passed;molintpassed for./pkg/util/export;golangci-lint -c .golangci.yml ./pkg/util/exportpassed with 0 issues.BVT is not applicable because this changes only the internal ETL background
file-selection contract and has no SQL-visible behavior.