From: Sage Weil Date: Tue, 27 Sep 2016 17:59:29 +0000 (-0400) Subject: os/bluestore: set min compressed blob size floor at 2x min_alloc_size X-Git-Tag: v11.0.1~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=beed433254ec26830a107886482ecd88af8dd34c;p=ceph.git os/bluestore: set min compressed blob size floor at 2x min_alloc_size Otherwise there's not point in compressing--we won't be able to allocation a smaller space to store it. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 307433409e45..57cbfb058188 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7687,6 +7687,13 @@ int BlueStore::_do_write( wctx.target_blob_size > g_conf->bluestore_max_blob_size) { wctx.target_blob_size = g_conf->bluestore_max_blob_size; } + // set the min blob size floor at 2x the min_alloc_size, or else we + // won't be able to allocate a smaller extent for the compressed + // data. + if (wctx.compress && + wctx.target_blob_size < min_alloc_size * 2) { + wctx.target_blob_size = min_alloc_size * 2; + } dout(20) << __func__ << " prefer csum_order " << wctx.csum_order << " target_blob_size 0x" << std::hex << wctx.target_blob_size