Skip to content

Add fsfreeze before unmounting stickydisk for snapshot consistency#40

Closed
adityamaru wants to merge 2 commits intomainfrom
devin/1763594238-add-fsfreeze-before-unmount
Closed

Add fsfreeze before unmounting stickydisk for snapshot consistency#40
adityamaru wants to merge 2 commits intomainfrom
devin/1763594238-add-fsfreeze-before-unmount

Conversation

@adityamaru
Copy link

@adityamaru adityamaru commented Nov 19, 2025

Add fsfreeze before unmounting stickydisk for snapshot consistency

Summary

This PR adds fsfreeze --freeze before unmounting the stickydisk filesystem to ensure file system consistency for Ceph RBD snapshots. According to Ceph documentation, RBD snapshots are crash-consistent unless coordinated with the mounting OS. The fsfreeze command quiesces I/O to ensure the filesystem is in a consistent state before the snapshot is taken.

Key changes:

  • Added fsfreeze --freeze call before the unmount retry loop in src/post.ts
  • Fsfreeze failures are logged as warnings but don't block the unmount process
  • No explicit unfreeze is needed - the filesystem is automatically unfrozen when unmount succeeds or retries

Review & Testing Checklist for Human

  • Verify fsfreeze availability: Confirm that fsfreeze command is available in the GitHub Actions runner environment where this action runs
  • Test unmount behavior: Run a workflow with stickydisks and verify that:
    • The filesystem is properly frozen before unmount (check logs for "Froze filesystem at..." message)
    • Unmount succeeds after freeze
    • No "device is busy" errors or other unmount failures
  • Validate snapshot consistency: After deploying this change, verify that Ceph RBD snapshots no longer require fsck passes when mounted
  • Check error handling: Confirm that the non-blocking error handling for fsfreeze (warning only) is appropriate - if fsfreeze fails, unmount should still proceed normally

Notes

  • The original implementation included explicit fsfreeze --unfreeze on unmount failure, but this was removed based on feedback that the filesystem automatically unfreezes on umount retry
  • This change is part of a coordinated update across three repositories: setup-docker-builder, stickydisk, and setup-bazel
  • The change is low-risk because fsfreeze failures are non-blocking and the unmount logic itself is unchanged

Session info:

Freeze filesystem before unmounting to ensure file system consistency
for Ceph RBD snapshots. This prevents crash-inconsistent snapshots by
quiescing I/O before the snapshot is taken.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

`Failed to freeze filesystem: ${error instanceof Error ? error.message : String(error)}`,
);
}

Copy link

Choose a reason for hiding this comment

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

Bug: Missing fsfreeze unfreeze in unmount failure path

When all 10 unmount attempts fail, the error is thrown without unfreezing the filesystem. If fsfreeze --freeze succeeded earlier but unmount fails, the filesystem remains frozen indefinitely, preventing any writes. The PR description explicitly states that fsfreeze --unfreeze should be added in the error path to prevent this scenario, but the implementation is missing this critical cleanup step.

Fix in Cursor Fix in Web

@devin-ai-integration devin-ai-integration bot changed the title Add fsfreeze before unmounting stickydisk Add fsfreeze before unmounting stickydisk for snapshot consistency Nov 20, 2025
@devin-ai-integration
Copy link

Closing this PR as requested.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant