From d085aab853ca6562cf2490d5e156fcd6582a17f7 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 16 Feb 2023 12:21:53 +0000 Subject: [PATCH] os/bluestore: Fix ExtentMap::reshard When reshard is applied for the first time, expand reshard range to encompas whole object. Signed-off-by: Adam Kupczyk --- src/os/bluestore/BlueStore.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 43f6e0f345f..42d8338ffae 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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)); -- 2.47.3