Keep PG count when optimize_change drops PGs instead of moving them #178
Open
koolkhel
wants to merge 3 commits from
koolkhel/vitastor:mon-keep-pg-count into master
pull from: koolkhel/vitastor:mon-keep-pg-count
merge into: vitalif:master
vitalif:master
vitalif:primary-stickiness
vitalif:libvfn
vitalif:canceling
vitalif:immediate-repeering
vitalif:rdma-close-tcp
vitalif:use-degraded-writes
vitalif:fix-write-delete-flow
vitalif:openssl-3.0.12
vitalif:openssl-capture-secrets
vitalif:ignore-small-rdma-end
vitalif:encrypt-batch
vitalif:faster-peering-calc
vitalif:http-hello
vitalif:xxh3-bench
vitalif:create-user-etcd-based
vitalif:aesxts_streaming_nosupport
vitalif:refactor-heap-continue-write
vitalif:ston3lu-patch-0127
vitalif:rdma-credits
vitalif:heap-meta
vitalif:sendmsg-zc-no-more-error
vitalif:fix-clear-refs
vitalif:veeam-trick
vitalif:test-etcd-schizo
vitalif:test
vitalif:test1
vitalif:test2
vitalif:cow-meta
vitalif:kv-readahead
vitalif:qemu-fix-crash-idea
vitalif:eventloop-auto-init-trigger
vitalif:hugo-docs
vitalif:node-mutex-and-postpone
vitalif:check-writeback
vitalif:msgr-iothreads-v2
vitalif:antietcd
vitalif:rel-1.4
vitalif:test-fix-ec-unknown-state-51
vitalif:kv-update
vitalif:kv-debug
vitalif:hotfix-1.2.0
vitalif:rdma-simple-nodp
vitalif:zerocopy-tcp-send
vitalif:csi-staging
vitalif:hotfix-1.1.0
vitalif:hotfix-1.0.0
vitalif:fsync-feedback
vitalif:cached-reads
vitalif:qemu-send-loop
vitalif:test-double-alloc
vitalif:hier-failure-domains
vitalif:mon-self-restart
vitalif:epoch-deletions
vitalif:rdma-flow-control
vitalif:csi-use-vitastor-cli
vitalif:rdma-v2
vitalif:etcd-hide-base64
vitalif:lrc-matrix
vitalif:rm-left-on-dead
vitalif:nfs-proxy-old
vitalif:non-odp-rdma
vitalif:test-zctr
vitalif:separate-data-connections
vitalif:sec_osd_msgr
vitalif:test-assert
vitalif:nbd-vmsplice
vitalif:allow-etcd-address-option
vitalif:rdma-zerocopy
vitalif:rel-0.5
vitalif:openonload
vitalif:sync-io-test
vitalif:trace-sync
vitalif:trace-sqes
vitalif:test-submit-and-wait
vitalif:test-sq-poll
vitalif:blocking-uring-test
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "koolkhel/vitastor:mon-keep-pg-count"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The LP in
optimize_change()has no constraint on the total PG count, andmake_int_pgs()scales whatever is left back topg_count. In an EC pool (ordered) a moved PG costs 2 or more, so the LP may prefer to drop PGs from overloaded failure domains rather than move them. The remaining PGs are then scaled back onto the same domains:A recheck doesn't fix it, since it sees the same input. Replicated pools are not affected (a moved PG costs 1).
optimize_change()now solves with the PG count fixed (sum(add - del) + sum(new) = pg_count - kept) and solves without it only when that is infeasible (failure domains that can't takepg_countPGs at their shares). The pool's change stats then say that some OSDs get more than their share. Where the LP without the condition already kept the PG count, the objective is the same, but lp_solve may return another solution with the same score.Found: on a 7-host EC 4+2 cluster a host was out for longer than
osd_out_timeand came back; it kept 1 PG instead of ~110, and the pool stayed at 85.3 % space efficiency.Tested: new
mon/lp_optimizer/test-optimize-keep-count.jscovers both cases above and the fallback (EC 4+2 on 6 hosts, one 3 times bigger). It fails on master (host 1 has 128 PGs, expected 109.7) and passes with the fix (109–110 PGs per host, 99.74 %, 110 PGs moved; 232–233 per host, 99.88 %, 233 moved). Same results throughgenerate_pool_pgs()with folded failure domains. The othermon/lp_optimizer/test-*.jsreach the same LP objective as on master;test-nonuniform.jsgets another solution with the same score (96.0 % space efficiency instead of 98.1 %), andtest-optimize-simple.jsfails with "Redistribution failed" on master too.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
Если так, то может сделать наоборот - сначала решать с доп.условием, а уж потом, если не получается - то без?
Сделал в
5cf77636: сначала решается с условием на число PG, без него только если решения нет, и тогда в статистике пула пишется, что часть OSD получает больше своей доли; в тест добавлен такой случай.Где и без условия число PG сохранялось, значение целевой функции то же, но lp_solve может вернуть другое решение с той же оценкой: в test-nonuniform.js эффективность 96,0 % вместо 98,1 %.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.