Skip to content

[Bug]: LocalFS transfer-page writes fail with EXDEV in Ubuntu UT workspace #26272

Closed

Description

@jiangxinmeng1

Is there an existing issue for the same bug?

Branch Name

4.2-dev (observed in PR #26252)

Commit ID

PR head: f7d6d015b206db38039d4a7b334a066f36e3d868

Base: 46dfc97cf284c51ce12095aa75618b1ef0410453

Other Environment Information

Actual Behavior

The Ubuntu/x86 UT job failed five unrelated embedded-cluster tests:

  • TestSpeedupAbortAllTxn
  • TestPreparedParams
  • TestInsertAndDeleteHashBasedWithAccount
  • TestDataBranchDiffAsFile
  • Test_UpgradeEntry

Before the timeouts and CN bootstrap panics, transfer-page persistence repeatedly failed with:

rename /tmp/.tmp.<id> transfer/<page>: invalid cross-device link
[TransferPage] write transfer page failed after 3 retries

The failures then surfaced as context deadline exceeded, txn commit status is unknown, and CN bootstrap panics across five independent packages.

This is not introduced by PR #26252:

  • The PR does not change pkg/fileservice, pkg/vm/engine/tae/model/pages.go, or any of the five failed test packages.
  • On the base commit, pkg/fileservice/local_fs.go already creates the temporary file under LocalFS.rootPath and finishes with a direct os.Rename(f.Name(), nativePath).
  • If the temporary file and destination resolve to different filesystems, Linux returns EXDEV; retrying the same rename cannot succeed.

Expected Behavior

LocalFS atomic writes used by transfer pages should keep the temporary file on the destination filesystem, or handle EXDEV safely, so CI workspace placement cannot make unrelated UT packages fail.

Steps to Reproduce

  1. Arrange the LocalFS temporary root and destination directory on different filesystems (matching the CI /tmp//mnt layout).
  2. Run an embedded-cluster test that persists transfer pages.
  3. Observe os.Rename return invalid cross-device link.
  4. Observe transfer-page retries exhaust and dependent cluster tests time out.

Additional information

The failed job's summary was:

FAIL_UT_CASES=TestSpeedupAbortAllTxn,TestPreparedParams,TestInsertAndDeleteHashBasedWithAccount,TestDataBranchDiffAsFile,Test_UpgradeEntry,

Potential fix direction: create the temporary file in the final destination directory before fsync + rename, preserving same-filesystem atomic rename semantics.

Activity

  1. jiangxinmeng1 commented on Jul 28, 2026

    @jiangxinmeng1
    ContributorAuthor

    Fix pushed in PR #26252, commit 8f585a4539. LocalFS now creates temporary files on the destination filesystem when rootPath is empty, covering both Write and NewWriter. A regression test uses /tmp and /dev/shm to verify cross-filesystem layouts.

  2. VioletQwQ-0 commented on Aug 5, 2026

    @VioletQwQ-0
    Collaborator

    This issue is reproducible on the current repository branches and should be reopened.

    PR #26658, while based on main, emitted the same LocalFS cross-filesystem
    rename failure in both Ubuntu UT modes:

    Observed repeatedly in the raw job logs:

    rename /tmp/.tmp.<id> transfer/<page>: invalid cross-device link
    [TransferPage] write transfer page failed after 3 retries
    

    During #26658 triage, a separate auto-increment clone-epoch regression was also
    identified and fixed. That separate PR bug does not explain or remove these
    LocalFS EXDEV records: the filesystem failure is the same portability defect
    tracked here and occurs in code unrelated to #26658's feature changes.

    The previous fix commit is:

    8f585a45397531f715a99987904eebf40859c807
    fix(fileservice): keep local temp files on target filesystem
    

    It was submitted as part of #26252, whose target branch was 4.2-dev.
    However, as of August 5, 2026, neither current branch tip contains that commit
    or its behavior:

    • main: 4dbb502e0efc3fdcf48869938c0acc53eff5f890
    • 4.2-dev: fa6c57cbfaba17d705ebc673bd49c06bf156e4d5

    Both current versions of pkg/fileservice/local_fs.go still create temporary
    files with os.CreateTemp(l.rootPath, ".tmp.*") and then rename them to the
    target path. When rootPath is empty and the relative destination is on a
    different filesystem, the final rename can still fail with EXDEV.

    Expected resolution:

    Existing-issue search found no separate issue that should supersede this one.
    #26008 contains an occurrence of the same transfer-page error, but its primary
    tracker was a logtail reconnect timeout and its comments already route the
    LocalFS common cause to #26272.

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

Metadata

Metadata

Assignees

Labels

bug/utkind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions