]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix ExtentMap::reshard
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 16 Feb 2023 12:21:53 +0000 (12:21 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 10 May 2023 11:47:46 +0000 (11:47 +0000)
When reshard is applied for the first time, expand reshard range to encompas whole object.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 43f6e0f345f3ce24b8d91f2cf48b5a58e9b2f7bf..42d8338ffae90df6f223ff03593c6eb34c4ddde1 100644 (file)
@@ -2767,6 +2767,12 @@ void BlueStore::ExtentMap::reshard(
     dout(20) << __func__ << "   shards [" << si_begin << "," << si_end << ")"
             << " over 0x[" << std::hex << needs_reshard_begin << ","
             << needs_reshard_end << ")" << std::dec << dendl;
+  } else {
+    // When sharding is not applied yet, it is an error to request reshard on range.
+    // The problem is that reshard() function will not touch any extent outside the range.
+    // Thus initial reshard() must encompass whole object.
+    needs_reshard_begin = 0;
+    needs_reshard_end = OBJECT_MAX_SIZE;
   }
 
   fault_range(db, needs_reshard_begin, (needs_reshard_end - needs_reshard_begin));