Skip to content

Commit

Permalink
test/store_test: fix DeferredWrite test when prefer_deferred_size=0
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/64443

Signed-off-by: Igor Fedotov <[email protected]>
  • Loading branch information
ifed01 committed Feb 15, 2024
1 parent 8259f75 commit ac4a48c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16252,7 +16252,9 @@ int BlueStore::_do_alloc_write(
if (!g_conf()->bluestore_debug_omit_block_device_write) {
if (data_size < prefer_deferred_size_snapshot) {
dout(20) << __func__ << " deferring 0x" << std::hex
<< l->length() << std::dec << " write via deferred" << dendl;
<< l->length() << " write via deferred, pds=0x"
<< prefer_deferred_size_snapshot
<< std::dec<< dendl;
bluestore_deferred_op_t *op = _get_deferred_op(txc, l->length());
op->op = bluestore_deferred_op_t::OP_WRITE;
int r = wi.b->get_blob().map(
Expand Down
9 changes: 9 additions & 0 deletions src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7030,6 +7030,15 @@ TEST_P(DeferredWriteTest, NewData) {
SetVal(g_conf(), "bluestore_min_alloc_size", stringify(t.min_alloc_size).c_str());
SetVal(g_conf(), "bluestore_max_blob_size", stringify(t.max_blob_size).c_str());
SetVal(g_conf(), "bluestore_prefer_deferred_size", stringify(t.prefer_deferred_size).c_str());
// bluestore_prefer_deferred_size set to 0 is a special case
// when hdd-/ssd-specific settings applied.
// Need to adjust them as well if we want to have no deferred ops at all
// Fixes: https://tracker.ceph.com/issues/64443
//
if (0 == t.prefer_deferred_size) {
SetVal(g_conf(), "bluestore_prefer_deferred_size_hdd", "0");
SetVal(g_conf(), "bluestore_prefer_deferred_size_ssd", "0");
}
g_conf().apply_changes(nullptr);
DeferredSetup();

Expand Down

0 comments on commit ac4a48c

Please sign in to comment.