diff --git a/0004-fix-mds-metadata-lost-in-one-case.patch b/0004-fix-mds-metadata-lost-in-one-case.patch new file mode 100644 index 0000000000000000000000000000000000000000..c790d4b0bf4a8f1fdd76ec49308ac2836513d4fa --- /dev/null +++ b/0004-fix-mds-metadata-lost-in-one-case.patch @@ -0,0 +1,42 @@ +From 56cbf3f0716b556c815487d719abe86021125925 Mon Sep 17 00:00:00 2001 +From: shimin +Date: Wed, 10 Apr 2024 09:10:04 +0800 +Subject: [PATCH] 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 +--- + src/mon/MDSMonitor.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc +index 4b27d828c..0ac5060f7 100644 +--- a/src/mon/MDSMonitor.cc ++++ b/src/mon/MDSMonitor.cc +@@ -136,6 +136,7 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap) + << ", my e " << get_fsmap().epoch << dendl; + ceph_assert(version > get_fsmap().epoch); + ++ load_metadata(pending_metadata); + load_health(); + + // read and decode +-- +2.27.0 + diff --git a/ceph.spec b/ceph.spec index e450a52d5730f7c763415b9951a65f81df858e11..ad932c5147988403c74ba5d5b2d7a648e91d9681 100644 --- a/ceph.spec +++ b/ceph.spec @@ -174,7 +174,7 @@ ################################################################################# Name: ceph Version: 18.2.2 -Release: 2 +Release: 3 %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -195,6 +195,7 @@ Source0: %{?_remote_tarball_prefix}ceph-18.2.2.tar.gz Patch1: 0001-modify-xsimd-source-to-local-and-set-cxx17-for-arrow.patch Patch2: 0002-fix-compilation-with-cython3.patch Patch3: 0003-fix-CVE-2023-46159.patch +Patch4: 0004-fix-mds-metadata-lost-in-one-case.patch %if 0%{?suse_version} # _insert_obs_source_lines_here @@ -2632,6 +2633,9 @@ exit 0 %{_datadir}/snmp/mibs %changelog +* Wed Apr 10 2024 cenhuilin - 2:18.2.2-3 +- mon: fix mds metadata lost in one case + * Fri Mar 22 2024 lizhipeng - 2:18.2.2-2 - fix CVE-2023-46159