Use murmur3 in the old PG combinator too ?
Test / buildenv (push) Successful in 9s Details
Test / build (push) Successful in 4m4s Details
Test / make_test (push) Successful in 38s Details
Test / test_cas (push) Successful in 7s Details
Test / test_change_pg_count (push) Successful in 39s Details
Test / test_change_pg_count_ec (push) Successful in 37s Details
Test / test_change_pg_size (push) Successful in 7s Details
Test / test_create_nomaxid (push) Successful in 7s Details
Test / test_etcd_fail (push) Successful in 55s Details
Test / test_add_osd (push) Successful in 2m49s Details
Test / test_interrupted_rebalance (push) Successful in 2m59s Details
Test / test_interrupted_rebalance_imm (push) Successful in 3m0s Details
Test / test_failure_domain (push) Successful in 11s Details
Test / test_interrupted_rebalance_ec (push) Successful in 2m32s Details
Test / test_snapshot (push) Successful in 35s Details
Test / test_minsize_1 (push) Successful in 13s Details
Test / test_snapshot_ec (push) Successful in 33s Details
Test / test_rm (push) Successful in 15s Details
Test / test_interrupted_rebalance_ec_imm (push) Successful in 2m4s Details
Test / test_move_reappear (push) Successful in 22s Details
Test / test_snapshot_down (push) Successful in 31s Details
Test / test_snapshot_down_ec (push) Successful in 29s Details
Test / test_splitbrain (push) Successful in 23s Details
Test / test_snapshot_chain (push) Successful in 2m39s Details
Test / test_snapshot_chain_ec (push) Successful in 3m13s Details
Test / test_rebalance_verify_imm (push) Successful in 4m25s Details
Test / test_rebalance_verify (push) Successful in 5m12s Details
Test / test_switch_primary (push) Successful in 33s Details
Test / test_write (push) Successful in 54s Details
Test / test_write_xor (push) Successful in 54s Details
Test / test_write_no_same (push) Successful in 13s Details
Test / test_rebalance_verify_ec_imm (push) Successful in 3m43s Details
Test / test_rebalance_verify_ec (push) Successful in 6m42s Details
Test / test_heal_pg_size_2 (push) Successful in 4m48s Details
Test / test_heal_csum_32k_dmj (push) Successful in 4m41s Details
Test / test_heal_ec (push) Successful in 5m42s Details
Test / test_heal_csum_32k_dj (push) Successful in 6m38s Details
Test / test_heal_csum_4k_dmj (push) Successful in 6m36s Details
Test / test_heal_csum_32k (push) Successful in 6m38s Details
Test / test_heal_csum_4k_dj (push) Successful in 6m28s Details
Test / test_scrub_zero_osd_2 (push) Successful in 59s Details
Test / test_scrub (push) Successful in 1m4s Details
Test / test_scrub_xor (push) Successful in 51s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 1m16s Details
Test / test_scrub_ec (push) Successful in 48s Details
Test / test_scrub_pg_size_3 (push) Successful in 1m36s Details
Test / test_nfs (push) Successful in 26s Details
Test / test_heal_csum_4k (push) Successful in 5m58s Details

Vitaliy Filippov 2024-01-02 12:52:02 +03:00
parent 416924f6a8
commit a0c2926c5e
1 changed files with 7 additions and 13 deletions

View File

@ -1,3 +1,5 @@
const { select_murmur3 } = require('./murmur3.js');
const NO_OSD = 'Z';
class SimpleCombinator
@ -61,14 +63,6 @@ function extract_osds(osd_tree, levels, osd_level, osds = {})
// ordered = don't treat (x,y) and (y,x) as equal
function random_combinations(osd_tree, pg_size, count, ordered)
{
let seed = 0x5f020e43;
let rng = () =>
{
seed ^= seed << 13;
seed ^= seed >> 17;
seed ^= seed << 5;
return seed + 2147483648;
};
const osds = Object.keys(osd_tree).reduce((a, c) => { a[c] = Object.keys(osd_tree[c]).sort(); return a; }, {});
const hosts = Object.keys(osd_tree).sort().filter(h => osds[h].length > 0);
const r = {};
@ -82,8 +76,8 @@ function random_combinations(osd_tree, pg_size, count, ordered)
cur_hosts.splice(h, 1);
for (let i = 1; i < pg_size && i < hosts.length; i++)
{
const next_host = rng() % cur_hosts.length;
const next_osd = rng() % osds[cur_hosts[next_host]].length;
const next_host = select_murmur3(cur_hosts.length, i => pg[0]+':i:'+cur_hosts[i]);
const next_osd = select_murmur3(osds[cur_hosts[next_host]].length, i => pg[0]+':i:'+osds[cur_hosts[next_host]][i]);
pg.push(osds[cur_hosts[next_host]][next_osd]);
cur_hosts.splice(next_host, 1);
}
@ -104,7 +98,7 @@ function random_combinations(osd_tree, pg_size, count, ordered)
{
for (let i = 0; i < max_hosts; i++)
{
const r = rng() % cur_hosts.length;
const r = select_murmur3(cur_hosts.length, i => count+':h:'+cur_hosts[i]);
host_idx[i] = cur_hosts[r];
cur_hosts.splice(r, 1);
}
@ -113,12 +107,12 @@ function random_combinations(osd_tree, pg_size, count, ordered)
{
for (let i = 0; i < max_hosts; i++)
{
const r = rng() % (cur_hosts.length - (max_hosts - i - 1));
const r = select_murmur3(cur_hosts.length - (max_hosts - i - 1), i => count+':h:'+cur_hosts[i]);
host_idx[i] = cur_hosts[r];
cur_hosts.splice(0, r+1);
}
}
let pg = host_idx.map(h => osds[hosts[h]][rng() % osds[hosts[h]].length]);
let pg = host_idx.map(h => osds[hosts[h]][select_murmur3(osds[hosts[h]].length, i => count+':o:'+osds[hosts[h]][i])]);
while (pg.length < pg_size)
{
pg.push(NO_OSD);