From 352caeba1478bec89b7418841e6959adb9648c2c Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 6 Sep 2020 02:27:44 +0300 Subject: [PATCH] Fix one more bug with replicated reads --- osd_primary.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osd_primary.cpp b/osd_primary.cpp index e0c72de0e..9735d4490 100644 --- a/osd_primary.cpp +++ b/osd_primary.cpp @@ -103,8 +103,10 @@ void osd_t::continue_primary_read(osd_op_t *cur_op) if (pg.state == PG_ACTIVE || op_data->scheme == POOL_SCHEME_REPLICATED) { // Fast happy-path - cur_op->buf = alloc_read_buffer(op_data->stripes, pg.pg_minsize, 0); - submit_primary_subops(SUBMIT_READ, op_data->target_ver, pg.pg_minsize, pg.cur_set.data(), cur_op); + cur_op->buf = alloc_read_buffer(op_data->stripes, + (op_data->scheme == POOL_SCHEME_REPLICATED ? 1 : pg.pg_minsize), 0); + submit_primary_subops(SUBMIT_READ, op_data->target_ver, + (op_data->scheme == POOL_SCHEME_REPLICATED ? pg.pg_size : pg.pg_minsize), pg.cur_set.data(), cur_op); op_data->st = 1; } else