]> review.fuel-infra Code Review - packages/trusty/ceph.git/commitdiff
Make the recovery after a crash during snapshotting easier 35/16535/2
authorAlexey Sheplyakov <asheplyakov@mirantis.com>
Thu, 28 Jan 2016 15:36:13 +0000 (18:36 +0300)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Thu, 28 Jan 2016 15:45:54 +0000 (18:45 +0300)
Added an upstream patch [1] which solves the problem.

[1] https://github.com/ceph/ceph/commit/aba6746b850e9397ff25570f08d0af8847a7162c

Closes-Bug: #1532967
Change-Id: I987cb9481507a02bf91c4bdd4e8669897c8fdde6

debian/changelog
debian/patches/PG-activate-handle-unexpected-cached_removed_snaps-m.patch [new file with mode: 0644]
debian/patches/series

index 08ec5bdbc109c1ce64e3485ccda6cef733343c4b..ee0ba3d426d3a1d27839d1546cf8fe0d56fdcee6 100644 (file)
@@ -1,3 +1,11 @@
+ceph (0.94.5-0u~u14.04+mos3) mos8.0; urgency=medium
+
+  * Added an upstream patch which makes recovery after a crash during
+    snapshotting easier: https://github.com/ceph/ceph/commit/aba6746b850
+    (LP: #1532967)
+
+ -- Alexey Sheplyakov <asheplyakov@mirantis.com>  Thu, 28 Jan 2016 18:43:10 +0300
+
 ceph (0.94.5-0u~u14.04+mos2) mos8.0; urgency=low
 
   * Backport upstream patches which fix the ceph-disk vs udev generated
diff --git a/debian/patches/PG-activate-handle-unexpected-cached_removed_snaps-m.patch b/debian/patches/PG-activate-handle-unexpected-cached_removed_snaps-m.patch
new file mode 100644 (file)
index 0000000..f48cec1
--- /dev/null
@@ -0,0 +1,63 @@
+From dcbaa3a99bffe7de65d404d21ae447b33cd49282 Mon Sep 17 00:00:00 2001
+From: Alexey Sheplyakov <asheplyakov@mirantis.com>
+Date: Thu, 21 Jan 2016 09:42:09 +0300
+Subject: [PATCH] PG::activate(): handle unexpected cached_removed_snaps more
+ gracefully
+
+PGPool::update(): ditto
+
+Fixes: #14538
+
+Signed-off-by: Alexey Sheplyakov <asheplyakov@mirantis.com>
+
+(cherry-picked from commit aba6746b850e9397ff25570f08d0af8847a7162c)
+---
+ src/osd/PG.cc | 25 ++++++++++++++++++++++---
+ 1 file changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/src/osd/PG.cc b/src/osd/PG.cc
+index c6b1d27..c08ad5d 100644
+--- a/src/osd/PG.cc
++++ b/src/osd/PG.cc
+@@ -158,8 +158,18 @@ void PGPool::update(OSDMapRef map)
+   name = map->get_pool_name(id);
+   if (pi->get_snap_epoch() == map->get_epoch()) {
+     pi->build_removed_snaps(newly_removed_snaps);
+-    newly_removed_snaps.subtract(cached_removed_snaps);
+-    cached_removed_snaps.union_of(newly_removed_snaps);
++    interval_set<snapid_t> intersection;
++    intersection.intersection_of(newly_removed_snaps, cached_removed_snaps);
++    if (intersection == cached_removed_snaps) {
++        newly_removed_snaps.subtract(cached_removed_snaps);
++        cached_removed_snaps.union_of(newly_removed_snaps);
++    } else {
++        lgeneric_subdout(g_ceph_context, osd, 0) << __func__
++          << " cached_removed_snaps shrank from " << cached_removed_snaps
++          << " to " << newly_removed_snaps << dendl;
++        cached_removed_snaps = newly_removed_snaps;
++        newly_removed_snaps.clear();
++    }
+     snapc = pi->get_snap_context();
+   } else {
+     newly_removed_snaps.clear();
+@@ -1550,7 +1560,16 @@ void PG::activate(ObjectStore::Transaction& t,
+     dout(20) << "activate - purged_snaps " << info.purged_snaps
+            << " cached_removed_snaps " << pool.cached_removed_snaps << dendl;
+     snap_trimq = pool.cached_removed_snaps;
+-    snap_trimq.subtract(info.purged_snaps);
++    interval_set<snapid_t> intersection;
++    intersection.intersection_of(snap_trimq, info.purged_snaps);
++    if (intersection == info.purged_snaps) {
++      snap_trimq.subtract(info.purged_snaps);
++    } else {
++        dout(0) << "warning: info.purged_snaps (" << info.purged_snaps
++                << ") is not a subset of pool.cached_removed_snaps ("
++                << pool.cached_removed_snaps << ")" << dendl;
++        snap_trimq.subtract(intersection);
++    }
+     dout(10) << "activate - snap_trimq " << snap_trimq << dendl;
+     if (!snap_trimq.empty() && is_clean())
+       queue_snap_trim();
+-- 
+1.9.1
+
index c7a8851180ad2ecab1bd7e599bbb0ed1c7cb68b9..55563bd1a0708e81b3457bdd0bef7d2e12412610 100644 (file)
@@ -15,3 +15,4 @@ ceph-osd-prestart-path.patch
 fix-argparse-defaults.patch
 fix-cycles-arch.patch
 vivid-does-systemd.patch
+PG-activate-handle-unexpected-cached_removed_snaps-m.patch