]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: rebuild snaprealm cache if last_modified or change_attr changed
authorDhairya Parmar <dparmar@redhat.com>
Wed, 23 Jul 2025 13:12:47 +0000 (18:42 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Thu, 25 Sep 2025 15:27:02 +0000 (20:57 +0530)
commitb47f88732fc31027305b069e4a9dba3ebed2f080
tree9ca38013b47cf8ef7db839ac193e003666f87c73
parent98452c28315b53f828a1e833e288d54b9b1e29c6
mds: rebuild snaprealm cache if last_modified or change_attr changed

For the server side snapdir visibility changes to be transported to the
client — SnapRealm cache needs to be rebuilt otherwise the same metadata
would be sent via the send_snap_update() in C_MDS_inode_update_finish() while
setting the `ceph.dir.subvolume.snaps.visible` vxattr.

The condition used to check for the `seq` and `last_destroyed` against their
cached values but for the vxattr change, it's a rather non-feasible
heavylifting to update the `seq` which involves a set of steps to prepare the
op, commit the op, journal the changes and update snap-server/client(s) just
for a mere flag update (and updating last_destroyed anyway doesn't make sense
for this case). So, compare last_modified and change_attr with their cached
values to check if the SnapRealm cache should be rebuilt. These values are
incremented in the Server::handle_client_setvxattr while toggling the
snapshot visibility xattr and this would enforce a cache rebuild.

Fixes: https://tracker.ceph.com/issues/71740
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/mds/SnapRealm.cc
src/mds/SnapRealm.h