Skip to content

[Bug]: ReadFileOffset boundary fixtures omit SQL file access policy and fail UT/coverage #30436

Closed

Description

@iamlinjunhong

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Searched open and closed MatrixOne issues for "SQL file access policy is required", "line_terminator_boundary_test", and "ReadFileOffset". The first two searches found no match. Issues #30341, #30378 and #30394 concern CSV splitting/reader ownership, rather than these fixtures missing the required SQL file authority context.

Branch Name

main; also observed on PR #27716, branch m-27655.

Commit ID

Official main: 47b9690.
PR head: 16fa9d9.

Other Environment Information

  • CI: Ubuntu/Linux x86_64, Go 1.27.1, CGo enabled, matrixone_test build tag.
  • Local paired reproduction: Darwin/arm64, Go 1.27.1, repository mo-cgo-test wrapper with existing native libraries verified as read-only build inputs.
  • Run 38933060718, original attempt 1, source PR fix: correct information schema views metadata #27716.

Actual Behavior

The four ReadFileOffset test groups in pkg/sql/colexec/external/line_terminator_boundary_test.go fail before reaching their delimiter/reader-ownership oracles:

  • TestReadFileOffsetNonStrictLineTerminators: 9 failing child cases.
  • TestReadFileOffsetNonStrictOverlappingBoundary: 4 failing child cases.
  • TestReadFileOffsetConflictingFieldTerminator: 8 failing child cases.
  • TestReadFileOffsetProbeOwnership: 7 failing child cases.

Both CI producers report the same 28 failing children plus their four parent tests. The stable error is:

Error Trace: pkg/sql/colexec/external/line_terminator_boundary_test.go:160
Error: Received unexpected error:
       internal error: SQL file access policy is required
Test: TestReadFileOffsetNonStrictLineTerminators/custom_embedded_LF

For the injected-error cases, the observed chain contains the same admission error instead of the intended read failed/close failed error. Other assertion locations are lines 214, 287, 358 and 361.

The tests construct context.Background() and put it into tree.ExternParam.ExParam.Ctx. ReadFileOffset calls plan.GetForETLWithType, which reaches SQL file access admission. fileservice.admitSQLFilePath correctly rejects a context without its statement-scoped policy. These fixtures do not establish that policy, so the intended ETL operation and its assertions are never reached. The fixtures and the policy enforcement are both present in official main; PR #27716 does not modify these tests or the admission mechanism.

Expected Behavior

The test fixtures should establish the appropriate statement-scoped SQL file access identity through the supported policy API before exercising an ETL file path. Production admission must continue rejecting a missing policy. All distinct splitting and reader-ownership oracles should remain enabled.

Steps to Reproduce

On official main 47b9690 with the repository CGo dependencies installed:

.agents/skills/mo-dev/scripts/mo-cgo-test \
  -short -v -tags matrixone_test -p 2 -count=1 -timeout=180s \
  -covermode=set -coverprofile="$TMPDIR/external-policy.cover" \
  -run '^TestReadFileOffset(NonStrictLineTerminators|NonStrictOverlappingBoundary|ConflictingFieldTerminator|ProbeOwnership)$' \
  ./pkg/sql/colexec/external

The paired local experiment executed this exact selection at the PR head and at exact official-main source inputs. Both exited 1 with all 28 child cases failing with the identical missing-policy signature (PR 3.926s; main 0.950s).

To preserve the managed PR worktree and comply with its prohibition on creating/checking out another worktree, the main control used a complete Go build overlay: all 79 differing tracked paths between the two revisions were mapped to their exact main blobs, including additions and deletions. All 3,581 selected repository compiler/embed inputs across 263 packages were independently checked against main Git blob hashes. Go module files and the native-library source trees are identical. The selected tests use literal CSV content and test-created temporary files; no differing tracked runtime fixture is read. The PR worktree stayed clean throughout. This is an exact-main source control on Darwin, not a claim to have reproduced the entire Linux CI environment.

CI coverage command uses go test -mod=readonly -count=1 -json -short -v -tags matrixone_test -timeout 20m -p <bounded parallelism> -covermode=set -coverprofile=... -coverpkg=<selected packages> <scope>. The ordinary UT producer uses the race-enabled CGo harness. The local focused coverage run proves this deterministic admission failure without claiming full-repository coverage or race success.

Additional information

All four failed jobs' complete logs were inspected:

Check Job Failure
Matrixone CI execution / UT Test on Ubuntu/x86 117081718788 UNIT TESTING FAILED: go-test=1, analysis=0; shell exit 2; the same four ReadFileOffset groups
Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 117081783002 Run coverage unit tests / Fail on coverage UT failure; test exit 1; same four groups
Matrixone Coverage execution / Coverage 117103756675 coverage merge blocked: a required producer did not publish a complete coverage profile; no coverage verdict was calculated
CI Required 117109277423 Error: matrixone-ci: failure, downstream required-job aggregation

Readable coverage incident artifact: ut-coverage-report-attempt-1. It records all 33 failure events including the package event. This is a deterministic main test-contract integration defect, not a flaky classification or a coverage percentage failure.

After this issue is verified, one gh run rerun 38933060718 --failed will be requested under the automated CI intake authorization. A rerun is not expected to repair the fixture defect; no assertion, policy check, unrelated production code, or PR review state is being changed to mask it.

Activity

  1. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    ContributorAuthor

    Attempt 2 of run 38933060718 has completed and reproduced the same deterministic failure at PR #27716 head 16fa9d92f1dfc4895d1b6147e2626632581d8e2b.

    Complete failed-job logs were read with gh run view 38933060718 --log-failed (8,800 lines). Both producers report only these four failing test groups in pkg/sql/colexec/external/line_terminator_boundary_test.go: TestReadFileOffsetNonStrictLineTerminators, TestReadFileOffsetNonStrictOverlappingBoundary, TestReadFileOffsetConflictingFieldTerminator, and TestReadFileOffsetProbeOwnership (28 failing children and four parents). The stable signature remains internal error: SQL file access policy is required, including the injected-error cases receiving that error instead of their intended read/close error.

    Official main is still 47b9690d7caec56b589fdefaf0684177412cffb2. The previously recorded exact-main control therefore remains valid: all 3,581 selected compiler inputs in 263 repository packages matched main Git blobs, and the same 28 child cases failed with the same admission error on both PR and main source inputs. The policy implementation and these test fixtures are outside PR #27716's changes. This is not reclassified as flaky merely because another attempt was run.

    The one authorized failed-jobs rerun for this run has been consumed. No further rerun is requested. The remaining repair is to establish the supported statement-scoped SQL file access policy in the four test fixtures while preserving production admission and all splitting/reader-ownership assertions. This upstream fixture repair should be handled under this issue rather than adding unrelated changes to the VIEWS PR.

  2. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    ContributorAuthor

    Additional exact-head occurrence: PR #30184, head 76f07bf691f4f921f567e88092e23e528ef0bf6a, run 38937537614, attempt 1.

    All four failed-job logs were retrieved with gh run view 38937537614 --log-failed (9,207 lines) and their failing steps inspected. Both UT producers report the same four parent groups and 28 children already covered by this issue:

    • TestReadFileOffsetNonStrictLineTerminators (9 children)
    • TestReadFileOffsetNonStrictOverlappingBoundary (4 children)
    • TestReadFileOffsetConflictingFieldTerminator (8 children)
    • TestReadFileOffsetProbeOwnership (7 children)

    The normalized error remains:

    pkg/sql/colexec/external/line_terminator_boundary_test.go:160
    Error: Received unexpected error:
           internal error: SQL file access policy is required
    Test: TestReadFileOffsetNonStrictLineTerminators/custom_embedded_LF
    

    The injected read/close-error cases also receive this admission error before reaching their intended oracle. No additional failing package, timeout, data race, compiler/type error or static-analysis failure appears in these failed-job logs.

    Check Job / failing step Result
    Ubuntu UT 117097387784, Unit Testing UNIT TESTING FAILED: go-test=1, analysis=0, shell exit 2
    Coverage UT 117097438375, Fail on coverage UT failure same four groups; producer exit 1
    Coverage 117121132554, Verify coverage prerequisites coverage merge blocked: a required producer did not publish a complete coverage profile; no coverage verdict was calculated
    CI Required 117121201256, Run actions/github-script downstream Error: matrixone-ci: failure

    The UT invocation is make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all, using the CGo/race/matrixone_test harness. Coverage invokes go test -mod=readonly -count=1 -json -short -v -tags matrixone_test -timeout=20m -p 8 -covermode=set -coverprofile=... -coverpkg=... <scope>.

    Attribution under the known-open-defect evidence path:

    1. This issue is still open and its maintainer analysis identifies the precise test contract: context.Background() reaches ReadFileOffset -> plan.GetForETLWithType -> fileservice.GetForETL -> admitSQLFilePath without a statement-scoped SQL policy. Production admission is correct; the fixtures omit required authority.
    2. The independent Linux/x64 occurrence is PR fix: correct information schema views metadata #27716 at head 16fa9d92f1dfc4895d1b6147e2626632581d8e2b, run 38933060718 attempt 2, UT job 117111435336. GitHub GET verifies that head, failed Unit Testing step and amd64-mo-shanghai-8c16g runner label. Its same four-group/missing-policy failure and exact official-main control are already recorded above.
    3. Fresh official-main fetch remains 47b9690d7caec56b589fdefaf0684177412cffb2; PR test(sql): lock normalized signed-zero set operations #30184 contains it. The complete 35-file PR diff does not alter the external loader tests/implementation, fileservice policy/admission or CI harness. The failing test file, external implementation and fileservice sources are byte-identical to main. Although plan/utils.go has unrelated set-operation changes, both etlPathWithType and GetForETLWithType are byte-identical to main. The failure occurs in admission before expression execution; the PR's set-key executor/registry and scalar fallback do not participate in that call path.
    4. Current exact-head evidence for the PR's own changes passes and was reused after verifying the clean unchanged head and all 19 recorded source hashes (17 production plus two measurement inputs): full protobuf-plan/function/planner/compile/colexec suites; public signed-zero race suite with 117 named PASS events (13.201s package); eight lifecycle modes under race (2.494s); 15-profile/100-sample capacity matrix (10.101s); seven-package vet and incremental lint (0 issues). Immutable RFC8 receipt records source fingerprints and measurement limitations.

    Reproduction remains the focused mo-cgo-test command in this issue's Steps to Reproduce at official main; no new local baseline execution or flaky classification is claimed in this event. The earlier exact-main control and independent Linux occurrence satisfy the approved open-defect comparison path. The PR worktree remains clean and no unrelated fixture, production policy or assertion was modified.

    After this evidence is posted and verified, one gh run rerun 38937537614 --failed will be requested. This is the first failed-jobs rerun for this run. It is a CI recheck, not a claim that rerunning repairs this deterministic upstream fixture defect.

  3. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    ContributorAuthor

    Additional occurrence on PR #30297, exact head 728780bacfad85ddf1db69f36879af62d7ebab5d: run 38940003540, attempt 1.

    The complete failed-job logs were read with gh run view 38940003540 --log-failed (9,353 lines). Both UT producers report only the same four parent groups and 28 children covered by this issue: TestReadFileOffsetNonStrictLineTerminators (9), TestReadFileOffsetNonStrictOverlappingBoundary (4), TestReadFileOffsetConflictingFieldTerminator (8), and TestReadFileOffsetProbeOwnership (7).

    pkg/sql/colexec/external/line_terminator_boundary_test.go:160
    Error: Received unexpected error:
           internal error: SQL file access policy is required
    Test: TestReadFileOffsetNonStrictLineTerminators/custom_embedded_LF
    

    Injected read/close-error cases receive the same admission error instead of their intended error. No additional failed package, data race, timeout, compile/type error or static-analysis failure appears in these failed-job logs.

    Check Failed job / step Result
    Ubuntu UT 117105057394, Unit Testing test failure; shell exit 2
    Coverage UT 117105103611, Fail on coverage UT failure same four groups; producer exit 1
    Coverage 117127062957, Verify coverage prerequisites required producer did not publish a complete profile; no coverage verdict calculated
    CI Required 117127144948, Run actions/github-script downstream matrixone-ci: failure

    UT runs make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all with CGo, race and matrixone_test. Coverage uses go test -mod=readonly -count=1 -json -short -v -tags matrixone_test -timeout=20m -p 8 -covermode=set -coverprofile=... -coverpkg=... <scope>. CI is Linux/amd64, Go 1.27.1.

    Attribution under the known-open-defect evidence path:

    1. This issue remains open and covers the exact cases and error class. Its maintainer analysis identifies missing statement-scoped authority in the fixtures' context.Background(): ReadFileOffset -> plan.GetForETLWithType -> fileservice.GetForETL -> getForETLWithParsedPath -> admitSQLFilePath. Admission fails before the delimiter and reader-ownership oracles. Production policy enforcement remains valid.
    2. Independently verified the unrelated PR fix: correct information schema views metadata #27716 Linux/x64 occurrence: UT job 117111435336, run 38933060718 attempt 2, head 16fa9d92f1dfc4895d1b6147e2626632581d8e2b, runner label amd64-mo-shanghai-8c16g. Read its complete 6,198-line job log; it contains only the same four failing groups and missing-policy signature. This issue's existing exact-main control at 47b9690d7caec56b589fdefaf0684177412cffb2 remains applicable; no new local main run is claimed.
    3. Fresh official main is still 47b9690d7caec56b589fdefaf0684177412cffb2, already contained in PR fix(sql): report explicit cast overflow warnings #30297. The complete PR delta is 17 files (15 Go and two CAST BVT files). It does not change the external-loader tests, SQL file admission mechanism or CI harness. The failing fixture, external implementation and fileservice admission sources match main Git blobs. Although the PR changes constant folding in plan/utils.go, GetForETLWithType and etlPathWithType are byte-identical to main; the CAST changes do not participate in this admission failure.
    4. Fresh current-head validation of the PR's own closure passed: complete function, rule, planner and colexec suites with -tags matrixone_test -short -vet=all -p 2 -count=1 (7.856s, 0.892s, 12.002s and 0.993s); real one-CN MySQL TestPreparedNumericTemporalContracts with -count=1 (root 8.93s, package/cleanup 10.171s), covering per-row warnings, temporal ownership across DECIMAL widths, prepared reuse and neighboring contracts. Current-head Linux arm64 SCA and both enabled BVT checks also succeeded. The worktree is clean.

    A focused local reproduction using the repository wrapper, -race -tags matrixone_test -short -vet=off -p 2 -count=1 -timeout=180s, and the four-root selection from this issue exited 1 with all 28 children failing with the same policy signature (package 1.103s). Local tests ran on Darwin/arm64, Go 1.27.1, with verified existing CGo libraries; this is not a claim to reproduce the entire Linux CI environment.

    This is the deterministic main fixture integration defect already tracked here. No unrelated test, production admission, assertion or PR review state was changed. After this evidence is posted and verified, one gh run rerun 38940003540 --failed will be requested, the first failed-jobs rerun for this run. A rerun is a CI recheck, not a claim that it repairs the fixture defect.

  4. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    ContributorAuthor

    Additional occurrence on PR #30438, exact head ccbc51664de60f4edbe4bcf03daa39560d486a89: run 38952815249, attempt 1.

    All four failed jobs' complete logs were read (gh run view 38952815249 --log-failed, 8,576 lines). Both UT producers report the same four ReadFileOffset groups and 28 children covered by this issue. The stable error is internal error: SQL file access policy is required, including injected read/close cases failing at admission before their intended oracle. No additional failing package, race, timeout, compiler or static-check failure was found.

    Check Job / failing step Result
    Ubuntu UT 117148258858, Unit Testing make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all; CGo/race/matrixone_test; test status 1, shell exit 2
    UT Coverage 117148314642, Fail on coverage UT failure coverage producer exit 1; same four groups
    Coverage 117168580612, Verify coverage prerequisites required producer did not publish a complete profile; no coverage verdict calculated
    CI Required 117168682293, Run actions/github-script downstream matrixone-ci: failure

    Known-open-defect comparison evidence was verified:

    1. This issue remains open. Its repository-member analysis identifies the missing fixture policy at ReadFileOffset -> plan.GetForETLWithType -> fileservice.GetForETL -> admitSQLFilePath. The handcrafted ExternParam reaches admission directly; it does not parse SQL or use the INLINE format-name grammar.
    2. The independent unrelated PR fix: correct information schema views metadata #27716 occurrence is UT job 117111435336, run 38933060718 attempt 2, head 16fa9d92f1dfc4895d1b6147e2626632581d8e2b. GitHub GET confirms its failed Unit Testing step and amd64-mo-shanghai-8c16g runner. The same four-group failure and exact-main source control at 47b9690d7caec56b589fdefaf0684177412cffb2 are already recorded in this issue.
    3. The complete PR fix(parser): normalize inline load format names #30438 delta has four files: INLINE format canonicalization in the MySQL grammar/generated parser, its parser regression, and its MySQL protocol regression. It does not change the boundary fixtures, ETL admission mechanism or CI harness. All production sources in the failed direct-call chain are unchanged. The tests set Format=CSV explicitly, so grammar normalization cannot cause this admission error.
    4. Current-head own-closure evidence passes: fresh complete MySQL parser package on Darwin/arm64, Go 1.27.1, repository wrapper, -short -tags matrixone_test -v -count=1 -timeout=180s (1.324s, all 18 TestLoadInlineFormat children passed). Exact-head Linux/x64 race CI also records TestLoadInlineFormatOverMySQLProtocol and both same-instance passes as passed (root 1.38s), and all embed package batches passed.

    Fresh local focused coverage reproduction at this PR head used:

    .agents/skills/mo-dev/scripts/mo-cgo-test -short -tags matrixone_test -count=1 -timeout=180s -covermode=set -coverprofile="$TMPDIR/pr30438-before.cover" -run '^TestReadFileOffset(NonStrictLineTerminators|NonStrictOverlappingBoundary|ConflictingFieldTerminator|ProbeOwnership)$' ./pkg/sql/colexec/external

    It exited 1 with the same 28 failing children (package 1.267s). This local Darwin/arm64 reproduction does not claim Linux platform equivalence or a new failure on current main.

    Official main has now advanced to 4e325495984c5f8a8dbf15500caa086d9e9159d1, which contains the exact four-fixture fix from #30439. The planned repair of PR #30438 is to rebase onto that merged upstream fix, preserve its original four-file patch, validate the previously failing tests, and push with the original exact-head lease. Production admission and existing assertions remain intact.

    Under the approved CI intake procedure, one failed-jobs rerun of run 38952815249 will be requested after this evidence is posted and verified. The old-head rerun is a recheck, not the repair or acceptance proof; the new rebased head will trigger fresh CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions