Compare commits

...

2 Commits

Author SHA1 Message Date
e3c8fd28b4 Allow to test EC writes with fio_blockstore
All checks were successful
Test / test_write_xor (push) Successful in 36s
Test / test_write_no_same (push) Successful in 9s
Test / test_write_iothreads (push) Successful in 42s
Test / test_heal_pg_size_2 (push) Successful in 2m17s
Test / test_heal_ec (push) Successful in 2m20s
Test / test_heal_local_read (push) Successful in 2m24s
Test / test_reweight_half (push) Successful in 11s
Test / test_snapshot_read_bitmap (push) Successful in 11s
Test / test_snapshot_pool2 (push) Successful in 16s
Test / test_heal_antietcd (push) Successful in 2m19s
Test / test_heal_csum_32k_dmj (push) Successful in 2m34s
Test / test_heal_csum_32k_dj (push) Successful in 2m34s
Test / test_heal_csum_32k (push) Successful in 2m34s
Test / test_heal_csum_4k_dmj (push) Successful in 2m31s
Test / test_resize_auto (push) Successful in 10s
Test / test_resize (push) Successful in 15s
Test / test_osd_tags (push) Successful in 11s
Test / test_enospc (push) Successful in 10s
Test / test_enospc_imm (push) Successful in 12s
Test / test_enospc_xor (push) Successful in 16s
Test / test_scrub (push) Successful in 12s
Test / test_enospc_imm_xor (push) Successful in 15s
Test / test_scrub_zero_osd_2 (push) Successful in 17s
Test / test_scrub_xor (push) Successful in 17s
Test / test_scrub_pg_size_3 (push) Successful in 18s
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 20s
Test / test_nfs (push) Successful in 12s
Test / test_scrub_ec (push) Successful in 18s
Test / test_heal_csum_4k_dj (push) Successful in 2m23s
Test / test_heal_csum_4k (push) Successful in 2m20s
2025-09-27 14:12:24 +03:00
d87e7d1a37 Optimize WA - do not move to the next journal sector until the actual write
All checks were successful
Test / test_write_no_same (push) Successful in 8s
Test / test_write_xor (push) Successful in 38s
Test / test_write_iothreads (push) Successful in 42s
Test / test_heal_pg_size_2 (push) Successful in 2m20s
Test / test_heal_local_read (push) Successful in 2m23s
Test / test_reweight_half (push) Successful in 12s
Test / test_snapshot_pool2 (push) Successful in 15s
Test / test_heal_ec (push) Successful in 2m18s
Test / test_snapshot_read_bitmap (push) Successful in 12s
Test / test_heal_antietcd (push) Successful in 2m22s
Test / test_heal_csum_32k_dj (push) Successful in 2m27s
Test / test_heal_csum_32k_dmj (push) Successful in 2m34s
Test / test_heal_csum_32k (push) Successful in 2m32s
Test / test_heal_csum_4k_dmj (push) Successful in 2m31s
Test / test_resize_auto (push) Successful in 10s
Test / test_resize (push) Successful in 16s
Test / test_osd_tags (push) Successful in 7s
Test / test_enospc (push) Successful in 14s
Test / test_enospc_xor (push) Successful in 16s
Test / test_enospc_imm (push) Successful in 11s
Test / test_enospc_imm_xor (push) Successful in 14s
Test / test_scrub (push) Successful in 12s
Test / test_scrub_zero_osd_2 (push) Successful in 15s
Test / test_scrub_xor (push) Successful in 16s
Test / test_scrub_pg_size_3 (push) Successful in 16s
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 19s
Test / test_scrub_ec (push) Successful in 16s
Test / test_nfs (push) Successful in 20s
Test / test_heal_csum_4k_dj (push) Successful in 2m24s
Test / test_heal_csum_4k (push) Successful in 2m28s
2025-09-27 11:23:05 +03:00
3 changed files with 71 additions and 11 deletions

View File

@@ -229,6 +229,8 @@ void blockstore_impl_t::loop()
{
// Mark journal sector writes as submitted
journal.sector_info[s].submit_id = 0;
if (journal.sector_info[s].submit_id)
journal.sector_info[s].written = true;
}
journal.submitting_sectors.clear();
if ((initial_ring_space - ringloop->space_left()) > 0)

View File

@@ -178,7 +178,7 @@ void blockstore_impl_t::prepare_journal_sector_write(int cur_sector, blockstore_
// Caller must ensure availability of an SQE
assert(sqe != NULL);
ring_data_t *data = ((ring_data_t*)sqe->user_data);
journal.sector_info[cur_sector].written = true;
// <written> flag will be set at the moment of actual submission
journal.sector_info[cur_sector].submit_id = ++journal.submit_id;
assert(journal.submit_id != 0); // check overflow
journal.submitting_sectors.push_back(cur_sector);

View File

@@ -26,6 +26,7 @@
#include "blockstore.h"
#include "epoll_manager.h"
#include "malloc_or_die.h"
#include "json11/json11.hpp"
#include "fio_headers.h"
@@ -37,6 +38,8 @@ struct bs_data
/* The list of completed io_u structs. */
std::vector<io_u*> completed;
int op_n = 0, inflight = 0;
bool ec = false;
bool imm = true;
bool last_sync = false;
bool trace = false;
};
@@ -45,6 +48,7 @@ struct bs_options
{
int __pad;
char *json_config = NULL;
int ec = 0;
int trace = 0;
};
@@ -58,6 +62,16 @@ static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_FILENAME,
},
{
.name = "ec",
.lname = "Use EC write method",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct bs_options, ec),
.help = "Use EC write method",
.def = "0",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_FILENAME,
},
{
.name = "bs_trace",
.lname = "trace",
@@ -88,6 +102,7 @@ static int bs_setup(struct thread_data *td)
return 1;
}
td->io_ops_data = bsd;
bsd->ec = o->ec;
if (!td->files_index)
{
@@ -148,6 +163,8 @@ static int bs_init(struct thread_data *td)
bsd->ringloop = new ring_loop_t(RINGLOOP_DEFAULT_SIZE);
bsd->epmgr = new epoll_manager_t(bsd->ringloop);
bsd->bs = new blockstore_t(config, bsd->ringloop, bsd->epmgr->tfd);
bsd->imm = config.find("immediate_commit") == config.end() ||
config["immediate_commit"] == "all";
while (1)
{
bsd->ringloop->loop();
@@ -203,7 +220,7 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
};
break;
case DDIR_WRITE:
op->opcode = BS_OP_WRITE_STABLE;
op->opcode = bsd->ec ? BS_OP_WRITE : BS_OP_WRITE_STABLE;
op->buf = io->xfer_buf;
op->oid = {
.inode = 1,
@@ -212,16 +229,57 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
op->version = 0; // assign automatically
op->offset = io->offset % bsd->bs->get_block_size();
op->len = io->xfer_buflen;
op->callback = [io, n = bsd->op_n](blockstore_op_t *op)
if (bsd->ec)
{
io->error = op->retval < 0 ? -op->retval : 0;
bs_data *bsd = (bs_data*)io->engine_data;
bsd->inflight--;
bsd->completed.push_back(io);
if (bsd->trace)
printf("--- OP_WRITE %zx n=%d retval=%d\n", (size_t)op, n, op->retval);
delete op;
};
op->callback = [io, n = bsd->op_n](blockstore_op_t *op)
{
bs_data *bsd = (bs_data*)io->engine_data;
if (bsd->trace)
printf("--- OP_WRITE %zx n=%d retval=%d\n", (size_t)op, n, op->retval);
if (op->retval < 0)
{
io->error = op->retval < 0 ? -op->retval : 0;
bsd->inflight--;
bsd->completed.push_back(io);
delete op;
}
else
{
auto stab_op = new blockstore_op_t;
stab_op->opcode = BS_OP_STABLE;
stab_op->buf = malloc_or_die(sizeof(obj_ver_id));
obj_ver_id *ver = (obj_ver_id *)stab_op->buf;
ver[0].oid = op->oid;
ver[0].version = op->version;
stab_op->len = 1;
stab_op->callback = [io, n](blockstore_op_t *op)
{
bs_data *bsd = (bs_data*)io->engine_data;
if (bsd->trace)
printf("--- OP_STABLE %zx n=%d retval=%d\n", (size_t)op, n, op->retval);
io->error = op->retval < 0 ? -op->retval : 0;
bsd->inflight--;
bsd->completed.push_back(io);
delete op;
};
bsd->bs->enqueue_op(stab_op);
delete op;
}
};
}
else
{
op->callback = [io, n = bsd->op_n](blockstore_op_t *op)
{
bs_data *bsd = (bs_data*)io->engine_data;
if (bsd->trace)
printf("--- OP_WRITE_STABLE %zx n=%d retval=%d\n", (size_t)op, n, op->retval);
io->error = op->retval < 0 ? -op->retval : 0;
bsd->inflight--;
bsd->completed.push_back(io);
delete op;
};
}
bsd->last_sync = false;
break;
case DDIR_SYNC: