Skip to content

This PR is to add comments to checkIfRemountRequired in ufs.go#6084

Open
uglis wants to merge 2 commits into
fluid-cloudnative:masterfrom
uglis:issue
Open

This PR is to add comments to checkIfRemountRequired in ufs.go#6084
uglis wants to merge 2 commits into
fluid-cloudnative:masterfrom
uglis:issue

Conversation

@uglis

@uglis uglis commented Jun 29, 2026

Copy link
Copy Markdown

I. Describe what this PR does
Add comments to checkIfRemountRequired function in fluid/pkg/ddc/alluxio/ufs.go.

II. Does this pull request fix one issue?
fixes #6083

III. Special notes for reviews
Generated comments describe the function's logic for checking whether a remount is needed by comparing MountTime with the master container start time.

Copilot AI review requested due to automatic review settings June 29, 2026 14:32
@fluid-e2e-bot

fluid-e2e-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

Hi @uglis. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds a descriptive comment block to the checkIfRemountRequired function in pkg/ddc/alluxio/ufs.go explaining its purpose and logic. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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

Pull request overview

Adds GoDoc-style documentation to checkIfRemountRequired in the Alluxio engine to clarify when and why Fluid triggers a UFS remount after an Alluxio master restart.

Changes:

  • Added a multi-line comment describing the remount decision logic based on runtime.Status.MountTime vs. the Alluxio master container StartedAt.
  • Clarified (in-code) that a master restart can invalidate mount state and require remounting unmounted UFS paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cheyang

cheyang commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

@uglis — this PR is blocked from merging by a failing DCO check.
The DCO bot requires every commit to carry a Signed-off-by: trailer; without it the PR cannot land regardless of lgtm / approved labels or otherwise-green CI.

Please resolve this now. For a single-commit PR:

git commit --amend -s
git push --force-with-lease

For multiple commits on this branch:

git rebase --signoff origin/master
git push --force-with-lease

The code review side is finished and any merge labels already on the PR will take effect once DCO turns green. Reference: https://github.com/apps/dco

Comment thread pkg/ddc/alluxio/ufs.go Outdated
// checkIfRemountRequired checks whether a remount operation is needed for the given UFS.
// It compares the runtime's MountTime with the Alluxio master container's start time.
// If the master container started after the last mount, it means the mount data was lost
// due to container restart, so it finds unmounted UFS paths and schedules a remount.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new doc-comment says the function "finds unmounted UFS paths and schedules a remount," but it omits the fallback branch: when FindUnmountedUFS() returns no paths, updateMountTime() is invoked so the runtime's MountTime is bumped to now and the same remount check does not re-fire on every reconcile. A short clause covering that case would make the doc match the implementation.

For example:

// If the master container started after the last mount, it means the in-memory
// mount state may not have survived the restart, so it schedules a remount for
// the unmounted UFS paths; if nothing needs to be remounted, it just refreshes
// the runtime's MountTime so the check doesn't keep firing.

Comment thread pkg/ddc/alluxio/ufs.go
return
}

// checkIfRemountRequired checks whether a remount operation is needed for the given UFS.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few lines below, ShouldSyncDatasetMounts uses the project's richer doc-comment template with explicit Parameters: and Returns: sections. Since you're adding fresh documentation here anyway, it would be nice to mirror that format for in-file consistency — for example noting that ufsToUpdate is an in/out parameter that the function may mutate (via AddMountPaths) to carry new mount paths back to the caller. Purely a consistency suggestion, not a blocker.

Comment thread pkg/ddc/alluxio/ufs.go Outdated

// checkIfRemountRequired checks whether a remount operation is needed for the given UFS.
// It compares the runtime's MountTime with the Alluxio master container's start time.
// If the master container started after the last mount, it means the mount data was lost

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function only compares timestamps (runtime.Status.MountTime.Before(startedAt)); it doesn't actually verify that mount data was lost. Wording such as "the in-memory mount state may not have survived the restart" or "previous mounts may no longer be present" would be a little more faithful to what the code observes versus what it concludes. Minor nit.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.77%. Comparing base (b0222b2) to head (d0bb7bf).
⚠️ Report is 88 commits behind head on master.

Files with missing lines Patch % Lines
pkg/ddc/alluxio/ufs.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6084      +/-   ##
==========================================
+ Coverage   62.59%   64.77%   +2.17%     
==========================================
  Files         480      484       +4     
  Lines       32801    33892    +1091     
==========================================
+ Hits        20533    21954    +1421     
+ Misses      10633    10215     -418     
- Partials     1635     1723      +88     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: xinque <231098078@smail.nju.edu.cn>
Signed-off-by: xinque <231098078@smail.nju.edu.cn>
@sonarqubecloud

Copy link
Copy Markdown

@cheyang

cheyang commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

/copilot review

@cheyang

cheyang commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Round 2 re-review: thanks for the quick turnaround. All three earlier documentation nits look addressed — the empty-unmountedPaths fallback (MountTime refresh) is now described, the doc adopts the Parameters: style used by the sibling ShouldSyncDatasetMounts, and the wording is nicely softened (the in-memory mount state may not have survived the restart). DCO also flipped to green on this SHA. From a code-review perspective this is ready; only the standard labels (/ok-to-test, /lgtm, /approve) remain.

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All CI checks passed and maintainer has approved. Auto-approving to satisfy branch protection.

@fluid-e2e-bot

fluid-e2e-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comments to checkIfRemountRequired in ufs.go

3 participants