Fix possible OSD crash during sync due to missing min_flushed_journal_sector reset
Test / buildenv (push) Successful in 10s Details
Test / build (push) Successful in 2m45s Details
Test / test_cas (push) Successful in 9s Details
Test / make_test (push) Successful in 32s Details
Test / test_change_pg_size (push) Successful in 9s Details
Test / test_change_pg_count (push) Successful in 37s Details
Test / test_change_pg_count_ec (push) Successful in 35s Details
Test / test_create_nomaxid (push) Successful in 9s Details
Test / test_etcd_fail (push) Successful in 1m38s Details
Test / test_interrupted_rebalance (push) Successful in 2m13s Details
Test / test_add_osd (push) Successful in 3m3s Details
Test / test_interrupted_rebalance_ec (push) Failing after 1m24s Details
Test / test_failure_domain (push) Failing after 41s Details
Test / test_interrupted_rebalance_imm (push) Successful in 3m4s Details
Test / test_snapshot (push) Successful in 26s Details
Test / test_minsize_1 (push) Successful in 17s Details
Test / test_snapshot_ec (push) Successful in 25s Details
Test / test_interrupted_rebalance_ec_imm (push) Successful in 1m23s Details
Test / test_rm (push) Successful in 16s Details
Test / test_snapshot_down (push) Successful in 24s Details
Test / test_move_reappear (push) Failing after 50s Details
Test / test_snapshot_down_ec (push) Successful in 27s Details
Test / test_splitbrain (push) Successful in 21s Details
Test / test_snapshot_chain (push) Successful in 2m26s Details
Test / test_snapshot_chain_ec (push) Successful in 3m2s Details
Test / test_rebalance_verify (push) Successful in 3m31s Details
Test / test_rebalance_verify_imm (push) Successful in 3m30s Details
Test / test_write (push) Successful in 53s Details
Test / test_write_xor (push) Successful in 57s Details
Test / test_write_no_same (push) Successful in 16s Details
Test / test_rebalance_verify_ec (push) Successful in 5m0s Details
Test / test_heal_pg_size_2 (push) Successful in 3m56s Details
Test / test_rebalance_verify_ec_imm (push) Successful in 6m28s Details
Test / test_heal_ec (push) Successful in 5m8s Details
Test / test_heal_csum_32k_dmj (push) Successful in 4m34s Details
Test / test_heal_csum_32k_dj (push) Successful in 5m44s Details
Test / test_heal_csum_32k (push) Successful in 6m28s Details
Test / test_scrub (push) Successful in 1m42s Details
Test / test_heal_csum_4k_dmj (push) Successful in 6m54s Details
Test / test_heal_csum_4k_dj (push) Successful in 5m52s Details
Test / test_scrub_zero_osd_2 (push) Successful in 52s Details
Test / test_scrub_xor (push) Successful in 50s Details
Test / test_scrub_pg_size_3 (push) Successful in 1m23s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 1m0s Details
Test / test_scrub_ec (push) Successful in 59s Details
Test / test_heal_csum_4k (push) Successful in 5m16s Details

hotfix-1.0.0
Vitaliy Filippov 2023-09-11 01:42:38 +03:00
parent f926f8c2e0
commit 4f99f78430
4 changed files with 10 additions and 21 deletions

View File

@ -393,6 +393,7 @@ void blockstore_impl_t::init_op(blockstore_op_t *op)
{
// Call constructor without allocating memory. We'll call destructor before returning op back
new ((void*)op->private_data) blockstore_op_private_t;
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
PRIV(op)->wait_for = 0;
PRIV(op)->op_state = 0;
PRIV(op)->pending_ops = 0;

View File

@ -210,7 +210,7 @@ struct blockstore_op_private_t
std::vector<copy_buffer_t> read_vec;
// Sync, write
int min_flushed_journal_sector, max_flushed_journal_sector;
uint64_t min_flushed_journal_sector, max_flushed_journal_sector;
// Write
struct iovec iov_zerofill[3];

View File

@ -198,6 +198,7 @@ void blockstore_impl_t::prepare_journal_sector_write(int cur_sector, blockstore_
priv->pending_ops++;
if (!priv->min_flushed_journal_sector)
priv->min_flushed_journal_sector = 1+cur_sector;
assert(priv->min_flushed_journal_sector <= journal.sector_count);
priv->max_flushed_journal_sector = 1+cur_sector;
}

View File

@ -378,7 +378,6 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + (loc << dsk.block_order) + op->offset - stripe_offset
);
PRIV(op)->pending_ops = 1;
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
if (immediate_commit != IMMEDIATE_ALL)
{
// Increase the counter, but don't save into unsynced_writes yet (can't sync until the write is finished)
@ -415,16 +414,10 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
write_iodepth++;
// Got SQEs. Prepare previous journal sector write if required
auto cb = [this, op](ring_data_t *data) { handle_write_event(data, op); };
if (immediate_commit == IMMEDIATE_NONE)
if (immediate_commit == IMMEDIATE_NONE &&
!journal.entry_fits(sizeof(journal_entry_small_write) + dyn_size))
{
if (!journal.entry_fits(sizeof(journal_entry_small_write) + dyn_size))
{
prepare_journal_sector_write(journal.cur_sector, op);
}
else
{
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
}
prepare_journal_sector_write(journal.cur_sector, op);
}
// Then pre-fill journal entry
journal_entry_small_write *je = (journal_entry_small_write*)prefill_single_journal_entry(
@ -750,17 +743,11 @@ int blockstore_impl_t::dequeue_del(blockstore_op_t *op)
}
write_iodepth++;
// Prepare journal sector write
if (immediate_commit == IMMEDIATE_NONE)
if (immediate_commit == IMMEDIATE_NONE &&
(dsk.journal_block_size - journal.in_sector_pos) < sizeof(journal_entry_del) &&
journal.sector_info[journal.cur_sector].dirty)
{
if ((dsk.journal_block_size - journal.in_sector_pos) < sizeof(journal_entry_del) &&
journal.sector_info[journal.cur_sector].dirty)
{
prepare_journal_sector_write(journal.cur_sector, op);
}
else
{
PRIV(op)->min_flushed_journal_sector = PRIV(op)->max_flushed_journal_sector = 0;
}
prepare_journal_sector_write(journal.cur_sector, op);
}
// Pre-fill journal entry
journal_entry_del *je = (journal_entry_del*)prefill_single_journal_entry(