Skip to content

mds: persist session auth_name in ESession journal event - #69037

Merged
vshankar merged 2 commits into
ceph:mainfrom
dparmar18:i76728
Jun 2, 2026
Merged

vshankar merged 2 commits into
ceph:mainfrom
dparmar18:i76728

Conversation

@dparmar18

@dparmar18 dparmar18 commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

So that it can be applied to the freshly creation session which happens while recreating session in ESession::replay when the OMAP version fell behind the ESession cmapv and the newly creation session would be rejected as target when a client tries to reclaim this session.

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

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 the cephfs Ceph File System label May 20, 2026
@dparmar18
dparmar18 requested a review from chrisphoffman May 20, 2026 21:26
@vshankar
vshankar requested a review from a team May 21, 2026 06:28
@vshankar

Copy link
Copy Markdown
Contributor

Waiting on @dparmar18 to update this PR with a test (as discussed).

@dparmar18

Copy link
Copy Markdown
Contributor Author

Ran locally, without patch:

2026-05-24 19:25:54,635.635 INFO:__main__:----------------------------------------------------------------------
2026-05-24 19:25:54,635.635 INFO:__main__:Ran 1 test in 79.669s
2026-05-24 19:25:54,635.635 INFO:__main__:
2026-05-24 19:25:54,635.635 INFO:__main__:FAILED (errors=1)
2026-05-24 19:25:54,635.635 INFO:__main__:
2026-05-24 19:25:54,635.635 INFO:__main__:
2026-05-24 19:25:54,635.635 INFO:__main__:======================================================================
2026-05-24 19:25:54,635.635 INFO:__main__:ERROR: test_reclaim_after_mds_failover (tasks.cephfs.test_reclaim.TestSessionReclaim.test_reclaim_after_mds_failover)
2026-05-24 19:25:54,635.635 INFO:__main__:That session reclaim succeeds after an MDS failover. (auth_name must
2026-05-24 19:25:54,635.635 INFO:__main__:----------------------------------------------------------------------
2026-05-24 19:25:54,635.635 INFO:__main__:Traceback (most recent call last):
2026-05-24 19:25:54,635.635 INFO:__main__:  File "/home/dhairya/CephRepoForTesting/ceph/qa/tasks/cephfs/test_reclaim.py", line 65, in test_reclaim_after_mds_failover
2026-05-24 19:25:54,635.635 INFO:__main__:    self.assertEqual(c2.start_reclaim(c1_uuid, CEPH_RECLAIM_RESET), 0)
2026-05-24 19:25:54,635.635 INFO:__main__:                     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-05-24 19:25:54,635.635 INFO:__main__:  File "cephfs_processed.pyx", line 3217, in cephfs.LibCephFS.start_reclaim
2026-05-24 19:25:54,635.635 INFO:__main__:cephfs.PermissionError: cannot start reclaim for session with uuid 836d9861-18fa-4315-8e73-6a10d11055e4:: Operation not permitted [Errno 1]

with patch:

2026-05-24 19:53:07,079.079 INFO:__main__:> ./bin/ceph log 'Ended test tasks.cephfs.test_reclaim.TestSessionReclaim.test_reclaim_after_mds_failover'
2026-05-24 19:53:07,887.887 INFO:__main__:Stopped test: test_reclaim_after_mds_failover (tasks.cephfs.test_reclaim.TestSessionReclaim.test_reclaim_after_mds_failover)
That session reclaim succeeds after an MDS failover. (auth_name must in 74.749489s
2026-05-24 19:53:07,887.887 INFO:__main__:test_reclaim_after_mds_failover (tasks.cephfs.test_reclaim.TestSessionReclaim.test_reclaim_after_mds_failover)
2026-05-24 19:53:07,887.887 INFO:__main__:That session reclaim succeeds after an MDS failover. (auth_name must ... ok
2026-05-24 19:53:07,887.887 INFO:__main__:
2026-05-24 19:53:07,887.887 INFO:__main__:----------------------------------------------------------------------
2026-05-24 19:53:07,887.887 INFO:__main__:Ran 1 test in 74.750s

@vshankar @chrisphoffman

Comment thread src/pybind/cephfs/cephfs.pyx Resolved
@dparmar18

Copy link
Copy Markdown
Contributor Author

without patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (1655 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
/home/dhairya/CephRepoForTesting/ceph/src/test/libcephfs/reclaim.cc:232: Failure
Expected equality of these values:
  ceph_start_reclaim(cmount, uuid, 1)
    Which is: -1
  0

[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover (60114 ms)
[----------] 2 tests from LibCephFS (61770 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (61770 ms total)
[  PASSED  ] 1 test.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover

with patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (587 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
[       OK ] LibCephFS.ReclaimResetAfterMDSFailover (61572 ms)
[----------] 2 tests from LibCephFS (62160 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (62160 ms total)
[  PASSED  ] 2 tests.

@vshankar

Copy link
Copy Markdown
Contributor

without patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (1655 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
/home/dhairya/CephRepoForTesting/ceph/src/test/libcephfs/reclaim.cc:232: Failure
Expected equality of these values:
  ceph_start_reclaim(cmount, uuid, 1)
    Which is: -1
  0

[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover (60114 ms)
[----------] 2 tests from LibCephFS (61770 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (61770 ms total)
[  PASSED  ] 1 test.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover

with patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (587 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
[       OK ] LibCephFS.ReclaimResetAfterMDSFailover (61572 ms)
[----------] 2 tests from LibCephFS (62160 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (62160 ms total)
[  PASSED  ] 2 tests.

Nice :)

Can you explain what was the issue in the test?

@dparmar18

Copy link
Copy Markdown
Contributor Author

without patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (1655 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
/home/dhairya/CephRepoForTesting/ceph/src/test/libcephfs/reclaim.cc:232: Failure
Expected equality of these values:
  ceph_start_reclaim(cmount, uuid, 1)
    Which is: -1
  0

[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover (60114 ms)
[----------] 2 tests from LibCephFS (61770 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (61770 ms total)
[  PASSED  ] 1 test.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] LibCephFS.ReclaimResetAfterMDSFailover

with patch:

$ ./bin/ceph_test_libcephfs_reclaim 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from LibCephFS
[ RUN      ] LibCephFS.ReclaimReset
[       OK ] LibCephFS.ReclaimReset (587 ms)
[ RUN      ] LibCephFS.ReclaimResetAfterMDSFailover
[       OK ] LibCephFS.ReclaimResetAfterMDSFailover (61572 ms)
[----------] 2 tests from LibCephFS (62160 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (62160 ms total)
[  PASSED  ] 2 tests.

Nice :)

Can you explain what was the issue in the test?

i committed the holy mistake of calling libcephfs APIs inside the child of fork() (dying_client_failover() to simulate a killed client) but without exec*(). Lesson learnt the hard way...

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

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

Minor nits, otherwise LGTM.

@dparmar18 you would want to add the "evicting ..." cluster warning to the relevant yaml.

Comment thread src/test/libcephfs/reclaim.cc Outdated
if (fd < 0)
return 1;

if (ceph_write(cmount, fd, "hello", 5, 0) < 0)

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.

nit :wrap inside {}.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread src/test/libcephfs/reclaim.cc Outdated
if (ceph_write(cmount, fd, "hello", 5, 0) < 0)
return 1;

if (ceph_fsync(cmount, fd, 0) != 0)

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.

nit :wrap inside {}.

return 1;

if (ceph_mkdir(cmount, "/reclaim_failover_test", 0755) != 0 && errno != EEXIST)
return 1;

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.

ditto

Comment thread src/test/libcephfs/reclaim.cc Outdated

ceph_set_uuid(cmount, uuid);

if (ceph_mount(cmount, "/") != 0)

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.

ditto

Comment thread src/test/libcephfs/reclaim.cc Outdated

ceph_set_session_timeout(cmount, 300);

if (ceph_start_reclaim(cmount, uuid, CEPH_RECLAIM_RESET) != -ENOENT)

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.

ditto (and other such instances in this change)


if (ceph_fsync(cmount, fd, 0) != 0)
return 1;

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.

ceph_close() after fsync? (doesn't matter much though, but...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no we arent doing ceph_close. dying_client_failover() returns with closing the session

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.

with or without?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agghh typo - without closing the session

@dparmar18

Copy link
Copy Markdown
Contributor Author

Minor nits, otherwise LGTM.

@dparmar18 you would want to add the "evicting ..." cluster warning to the relevant yaml.

ah okay, let me do that real quick

@dparmar18

dparmar18 commented May 26, 2026 •

Copy link
Copy Markdown
Contributor Author

evicting

did you mean Respawning...? @vshankar

@vshankar

vshankar commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

evicting

did you mean Respawning...? @vshankar

No. When the old client is blocklisted, the MDS will log to cluster log. See: https://github.com/ceph/ceph/blob/main/src/mds/MDSRank.cc#L3946

EDIT: Unless that message is already in the ignore list.

@vshankar

Copy link
Copy Markdown
Contributor

evicting

did you mean Respawning...? @vshankar

No. When the old client is blocklisted, the MDS will log to cluster log. See: https://github.com/ceph/ceph/blob/main/src/mds/MDSRank.cc#L3946

EDIT: Unless that message is already in the ignore list.

@dparmar18 nvm -- the cluster log is at INFO level, so no need for add to ignore list.

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

LGTM, nice work all!

@dparmar18

Copy link
Copy Markdown
Contributor Author

@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. Well done!

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

@vshankar

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-05-26-16:20.

@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 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

jenkins retest this please

dparmar18 added 2 commits June 2, 2026 10:27
So that it can be applied to the freshly creation session which happens
while recreating session in ESession::replay when the OMAP version fell
behind the ESession cmapv and the newly creation session would be
rejected as target when a client tries to reclaim this session.

Fixes: https://tracker.ceph.com/issues/76728
Signed-off-by: Dhairya Parmar <[email protected]>
ensure that the new active MDS reads the auth_name from the ESession
event and assigns it to the new session that MDS creates during journal
replay.

NOTE: the mds failover is carried by sending "respawn" command to active
MDS using libcephfs's ceph_mds_command().

Fixes: https://tracker.ceph.com/issues/76728
Signed-off-by: Dhairya Parmar <[email protected]>
@vshankar

vshankar commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

(force push to get jenkins tests running)

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

Labels

cephfs Ceph File System tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants