]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: fix mds metadata lost in one case. 53883/head
authorshimin <shimin@kuaishou.com>
Sun, 8 Oct 2023 11:15:09 +0000 (19:15 +0800)
committershimin <shimin@kuaishou.com>
Wed, 11 Oct 2023 02:41:50 +0000 (10:41 +0800)
commit56cbf3f0716b556c815487d719abe86021125925
tree15ec144bb29f9d5ff52ecf18ad4c5bf5c9961566
parent03e43c5bb08452b06a89c14de5a9ff7f9f82a3e1
mon: fix mds metadata lost in one case.

In most cases, peon's pending_metadata is inconsistent with mon's db.
When a peon turns into leader, and at the same time a active mds stops,
the new leader may flush wrong mds metadata into db. So we meed to
update mds metadata from db at every fsmap change.

This phenomenon can be reproduce like this:
A Cluster with 3 mon and 3 mds (one active, other two standby), 6 osd.
step 1. stop two standby mds;
step 2. restart all mon; (make pending_medata consistent with db)
step 3. start other two mds
step 4. stop leader mon
step 5. run "ceph mds metadata" command to check mds metadata
step 6. stop active mds
step 7. run "ceph mds metadata" command to check mds metadata again

In step 7, we would find mds metadata lost.

Fixes: https://tracker.ceph.com/issues/63166
Signed-off-by: shimin <shimin@kuaishou.com>
src/mon/MDSMonitor.cc