Skip to content

tools/cephfs_mirror: fix re-appearance of removed checkpoints - #70221

Merged
vshankar merged 5 commits into
ceph:mainfrom
karthik-us1:checkpoint-remove-issue
Nov 10, 2026
Merged

vshankar merged 5 commits into
ceph:mainfrom
karthik-us1:checkpoint-remove-issue

Conversation

@karthik-us1

@karthik-us1 karthik-us1 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

After snapshot metadata mutation (PR #66723), the mgr can remove a
checkpoint while the mirror daemon is syncing. The mirror daemon may
still see stale inode metadata and recreate checkpoint keys when sync
completes.

Add a new flag CEPH_SNAP_MD_OP_UPDATE to update an existing snap
metadata key and reject the operation when the key is absent.
Use CEPH_SNAP_MD_OP_UPDATE for checkpoint status transitions so the
mirror daemon cannot recreate keys that were removed on the MDS.

Fixes: https://tracker.ceph.com/issues/77992

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added cephfs Ceph File System tests labels Jul 15, 2026
@kotreshhr kotreshhr self-assigned this Jul 23, 2026
Comment thread src/client/Client.cc Resolved
Comment thread src/client/Client.cc Resolved
Comment thread qa/tasks/cephfs/test_mirroring.py Resolved
Comment thread src/client/Client.cc Resolved
@karthik-us1
karthik-us1 force-pushed the checkpoint-remove-issue branch from 29cfa0d to b530b47 Compare August 21, 2026 16:44
Comment thread src/tools/cephfs_mirror/Checkpoint.cc Resolved
Comment thread src/tools/cephfs_mirror/Checkpoint.cc Resolved
@kotreshhr

Copy link
Copy Markdown
Contributor

lgtm otherwise

@kotreshhr

Copy link
Copy Markdown
Contributor

nit: Fix PR description, which is referring to old approach

@karthik-us1
karthik-us1 force-pushed the checkpoint-remove-issue branch from b530b47 to 8a5638f Compare September 22, 2026 12:15
@karthik-us1

Copy link
Copy Markdown
Contributor Author

nit: Fix PR description, which is referring to old approach

Fixed

@kotreshhr kotreshhr 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.

lgtm

@kotreshhr

Copy link
Copy Markdown
Contributor

@chrisphoffman Could you re-check this PR ? The approach is changed.

@kotreshhr

Copy link
Copy Markdown
Contributor

@vshankar ptal

@karthik-us1

Copy link
Copy Markdown
Contributor Author

@vshankar & @chrisphoffman a gentle nudge for review.

@vshankar vshankar 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.

LGTM.

@chrisphoffman chrisphoffman 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.

looks good from client perspective

@vshankar

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-10-27-04:37.

@vshankar vshankar 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.

Build fails with:

/ceph/rpmbuild/BUILD/ceph-21.3.0-4886-g12bbe943/src/tools/cephfs_mirror/Checkpoint.cc:203:26: error: ‘CHECKPOINT_METADATA_KEY_LIST’ was not declared in this scope
  203 |   for (const auto &key : CHECKPOINT_METADATA_KEY_LIST) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ceph/rpmbuild/BUILD/ceph-21.3.0-4886-g12bbe943/src/tools/cephfs_mirror/Checkpoint.cc: In function ‘int cephfs::mirror::remove_checkpoint_metadata(MountRef, const std::string&, const std::set<std::__cxx11::basic_string<char> >&)’:
/ceph/rpmbuild/BUILD/ceph-21.3.0-4886-g12bbe943/src/tools/cephfs_mirror/Checkpoint.cc:217:26: error: ‘CHECKPOINT_METADATA_KEY_LIST’ was not declared in this scope
  217 |   for (const auto &key : CHECKPOINT_METADATA_KEY_LIST) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/tools/cephfs_mirror/CMakeFiles/cephfs_mirror_internal.dir/build.make:79: src/tools/cephfs_mirror/CMakeFiles/cephfs_mirror_internal.dir/Checkpoint.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

@karthik-us1

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@karthik-us1

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@kotreshhr

Copy link
Copy Markdown
Contributor

@vshankar please take this on your next qa run

@vshankar

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-10-31-06:57.

@vshankar

vshankar commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Hey @karthik-us1 -- the test added in this change fails in teuthology. See: https://pulpito.ceph.com/vshankar-2026-10-31_09:11:20-fs-wip-vshankar-testing-20261031.065707-distro-default-trial/698758/

I could not get to debugging it. Could you please have a look?

@karthik-us1
karthik-us1 force-pushed the checkpoint-remove-issue branch from a44d6c8 to 0ff4400 Compare November 2, 2026 09:34
@karthik-us1

Copy link
Copy Markdown
Contributor Author

Hey @karthik-us1 -- the test added in this change fails in teuthology. See: https://pulpito.ceph.com/vshankar-2026-10-31_09:11:20-fs-wip-vshankar-testing-20261031.065707-distro-default-trial/698758/

I could not get to debugging it. Could you please have a look?

Seems like timing issue, have increased the timeout and fixed the logging part in case of retry failure. Will trigger the test and update here with the result or after fixing any issues if uncovered.

@vshankar

vshankar commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Seems like timing issue, have increased the timeout and fixed the logging part in case of retry failure. Will trigger the test and update here with the result or after fixing any issues if uncovered.

OK. I will drop this change from my test branch now.

@kotreshhr

Copy link
Copy Markdown
Contributor

Hey @karthik-us1 -- the test added in this change fails in teuthology. See: https://pulpito.ceph.com/vshankar-2026-10-31_09:11:20-fs-wip-vshankar-testing-20261031.065707-distro-default-trial/698758/
I could not get to debugging it. Could you please have a look?

Seems like timing issue, have increased the timeout and fixed the logging part in case of retry failure. Will trigger the test and update here with the result or after fixing any issues if uncovered.

@karthik-us1 Since you have this build, pls run the qa against this build and validate.

@karthik-us1

Copy link
Copy Markdown
Contributor Author

Hey @karthik-us1 -- the test added in this change fails in teuthology. See: https://pulpito.ceph.com/vshankar-2026-10-31_09:11:20-fs-wip-vshankar-testing-20261031.065707-distro-default-trial/698758/
I could not get to debugging it. Could you please have a look?

Seems like timing issue, have increased the timeout and fixed the logging part in case of retry failure. Will trigger the test and update here with the result or after fixing any issues if uncovered.

@karthik-us1 Since you have this build, pls run the qa against this build and validate.

@kotreshhr, I have triggered it on this: #70221 (comment) build.

@karthik-us1
karthik-us1 force-pushed the checkpoint-remove-issue branch from 0ff4400 to 834a1d2 Compare November 3, 2026 05:33
@karthik-us1

Copy link
Copy Markdown
Contributor Author

Hey @karthik-us1 -- the test added in this change fails in teuthology. See: https://pulpito.ceph.com/vshankar-2026-10-31_09:11:20-fs-wip-vshankar-testing-20261031.065707-distro-default-trial/698758/
I could not get to debugging it. Could you please have a look?

Seems like timing issue, have increased the timeout and fixed the logging part in case of retry failure. Will trigger the test and update here with the result or after fixing any issues if uncovered.

The issue was that the sync was completing before we could observe the syncing state and remove the checkpoint during sync. I have increased the load and now it should be good. Except the other 2 flaky test case failures in 2 runs, the newly added test succeeded: https://pulpito-ng.ceph.com/runs/karthik-us1-2026-11-02_14:02:00-fs-wip-karthik-us1-70221-fix-checkpoint-reappearance-2026-10-28-distro-default-trial

@vshankar please take this in your next qa run.

@kotreshhr

Copy link
Copy Markdown
Contributor

The issue was that the sync was completing before we could observe the syncing state and remove the checkpoint during sync. I have increased the load and now it should be good. Except the other 2 flaky test case failures in 2 runs, the newly added test succeeded: https://pulpito-ng.ceph.com/runs/karthik-us1-2026-11-02_14:02:00-fs-wip-karthik-us1-70221-fix-checkpoint-reappearance-2026-10-28-distro-default-trial

@karthik-us1 I am also facing similar issue in other test #73042 Just increasing the load will again be flaky based on teuthology machine load. Let's give the test a few more chances by trying with another snapshot?

@vshankar

vshankar commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been removed from main integration testing by vshankar started 2026-10-31-06:57.

Add CEPH_SNAP_MD_OP_UPDATE to update an existing snap metadata key and
reject the operation when the key is absent.

Fixes: https://tracker.ceph.com/issues/77992
Signed-off-by: Karthik U S <[email protected]>
After snapshot metadata mutation (PR ceph#66723), the mgr can remove a
checkpoint while the mirror daemon is syncing. The mirror daemon may
still see stale inode metadata and recreate checkpoint keys when sync
completes.

Use CEPH_SNAP_MD_OP_UPDATE for checkpoint status transitions so the
mirror daemon cannot recreate keys that were removed on the MDS.

Fixes: https://tracker.ceph.com/issues/77992
Signed-off-by: Karthik U S <[email protected]>
Add integration test for removing a checkpoint while snapshot sync is
in progress, and a libcephfs test for the UPDATE-only snap metadata op.

Fixes: https://tracker.ceph.com/issues/77992
Signed-off-by: Karthik U S <[email protected]>
@karthik-us1
karthik-us1 force-pushed the checkpoint-remove-issue branch from 834a1d2 to 06538b9 Compare November 5, 2026 04:31
@karthik-us1

karthik-us1 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

The issue was that the sync was completing before we could observe the syncing state and remove the checkpoint during sync. I have increased the load and now it should be good. Except the other 2 flaky test case failures in 2 runs, the newly added test succeeded: https://pulpito-ng.ceph.com/runs/karthik-us1-2026-11-02_14:02:00-fs-wip-karthik-us1-70221-fix-checkpoint-reappearance-2026-10-28-distro-default-trial

@karthik-us1 I am also facing similar issue in other test #73042 Just increasing the load will again be flaky based on teuthology machine load. Let's give the test a few more chances by trying with another snapshot?

Done. Also added the freeze logic for the mirror daemon similar to that of #73042 so that the sync will not complete after we get the syncing state, but before the checkpoint is removed, which is the race that was causing the issue.
Successful test run: https://pulpito-ng.ceph.com/runs/karthik-us1-2026-11-04_17:12:50-fs-wip-karthik-us1-70221-fix-checkpoint-reappearance-2026-10-28-distro-default-trial

@vshankar

vshankar commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-11-06-10:30.

@vshankar vshankar 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.

@vshankar
vshankar merged commit e01a5bc into ceph:main Nov 10, 2026
16 checks passed
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.

4 participants