Fix eviction when random_pos selects the end
Test / buildenv (push) Successful in 12s Details
Test / build (push) Successful in 3m36s Details
Test / make_test (push) Successful in 38s Details
Test / test_cas (push) Failing after 1s Details
Test / test_change_pg_count (push) Failing after 1s Details
Test / test_change_pg_count_ec (push) Failing after 1s Details
Test / test_change_pg_size (push) Failing after 1s Details
Test / test_create_nomaxid (push) Failing after 1s Details
Test / test_add_osd (push) Successful in 1m44s Details
Test / test_interrupted_rebalance (push) Failing after 1s Details
Test / test_interrupted_rebalance_imm (push) Failing after 1s Details
Test / test_interrupted_rebalance_ec (push) Failing after 1s Details
Test / test_interrupted_rebalance_ec_imm (push) Failing after 1s Details
Test / test_failure_domain (push) Failing after 1s Details
Test / test_snapshot (push) Failing after 1s Details
Test / test_snapshot_ec (push) Failing after 1s Details
Test / test_minsize_1 (push) Failing after 2s Details
Test / test_move_reappear (push) Failing after 1s Details
Test / test_rm (push) Failing after 1s Details
Test / test_snapshot_chain (push) Failing after 1s Details
Test / test_snapshot_chain_ec (push) Failing after 1s Details
Test / test_snapshot_down (push) Failing after 1s Details
Test / test_snapshot_down_ec (push) Failing after 1s Details
Test / test_splitbrain (push) Failing after 1s Details
Test / test_rebalance_verify (push) Failing after 1s Details
Test / test_rebalance_verify_imm (push) Failing after 1s Details
Test / test_rebalance_verify_ec (push) Failing after 1s Details
Test / test_rebalance_verify_ec_imm (push) Failing after 1s Details
Test / test_switch_primary (push) Failing after 1s Details
Test / test_write (push) Failing after 1s Details
Test / test_write_xor (push) Failing after 1s Details
Test / test_etcd_fail (push) Successful in 47s Details
Test / test_heal_pg_size_2 (push) Failing after 1s Details
Test / test_heal_ec (push) Failing after 1s Details
Test / test_heal_csum_32k_dmj (push) Failing after 1s Details
Test / test_heal_csum_32k_dj (push) Failing after 1s Details
Test / test_heal_csum_32k (push) Failing after 1s Details
Test / test_heal_csum_4k_dmj (push) Failing after 1s Details
Test / test_write_no_same (push) Successful in 16s Details
Test / test_scrub (push) Failing after 1s Details
Test / test_scrub_zero_osd_2 (push) Failing after 1s Details
Test / test_scrub_xor (push) Failing after 1s Details
Test / test_scrub_pg_size_3 (push) Failing after 1s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Failing after 1s Details
Test / test_scrub_ec (push) Failing after 1s Details
Test / test_heal_csum_4k_dj (push) Successful in 4m16s Details
Test / test_heal_csum_4k (push) Successful in 4m15s Details

Vitaliy Filippov 2023-12-01 01:15:02 +03:00
parent 87a2dab9fc
commit 7ef14d586f
1 changed files with 9 additions and 8 deletions

View File

@ -830,9 +830,17 @@ static void try_evict(kv_db_t *db)
int misses = 0;
bool wrapped = false;
while (db->block_cache.size() > db->cache_max_blocks &&
(!wrapped || *random_it < random_pos) &&
(db->evict_max_misses <= 0 || misses < db->evict_max_misses))
{
if (random_it == db->block_levels.end() || (*random_it >> (64-LEVEL_BITS)) > evict_level)
{
if (wrapped)
break;
random_it = db->block_levels.lower_bound(evict_level << (64-LEVEL_BITS));
wrapped = true;
}
else if (wrapped && *random_it >= random_pos)
break;
auto b_it = db->block_cache.find((*random_it & NO_LEVEL_MASK) * db->kv_block_size);
auto blk = &b_it->second;
if (b_it != db->block_cache.end() && !blk->updating && blk->usage < db->usage_counter)
@ -845,13 +853,6 @@ static void try_evict(kv_db_t *db)
random_it++;
misses++;
}
if (random_it == db->block_levels.end() || (*random_it >> (64-LEVEL_BITS)) > evict_level)
{
if (wrapped)
break;
random_it = db->block_levels.lower_bound(evict_level << (64-LEVEL_BITS));
wrapped = true;
}
}
if (db->block_cache.size() <= db->cache_max_blocks)
{