]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonState: fix serialization/storage of device life expectancy min/max
authorSage Weil <sage@newdream.net>
Mon, 8 Feb 2021 16:41:48 +0000 (10:41 -0600)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Mar 2021 07:34:15 +0000 (15:34 +0800)
These weren't encoded as strings, which means they were effectively
forgotton on each mgr restart.  Sigh.

Fixes: https://tracker.ceph.com/issues/49215
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 78b72b0be752fce855203b28b558133a0d47eba8)

src/mgr/DaemonState.cc

index 07d5854179905b5f10c80cfb278dbc5e209c0fb1..b9e1b04ea6c9981fb62be5316b9841a37e1af8b5 100644 (file)
@@ -46,12 +46,12 @@ void DeviceState::set_life_expectancy(utime_t from, utime_t to, utime_t now)
   life_expectancy = make_pair(from, to);
   life_expectancy_stamp = now;
   if (from != utime_t()) {
-    metadata["life_expectancy_min"] = from;
+    metadata["life_expectancy_min"] = stringify(from);
   } else {
     metadata["life_expectancy_min"] = "";
   }
   if (to != utime_t()) {
-    metadata["life_expectancy_max"] = to;
+    metadata["life_expectancy_max"] = stringify(to);
   } else {
     metadata["life_expectancy_max"] = "";
   }