osd: Merge object lists on peering instead of copying and sorting them #180
Open
koolkhel
wants to merge 3 commits from
koolkhel/vitastor:osd-peering-merge into master
pull from: koolkhel/vitastor:osd-peering-merge
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:osd-peering-merge"
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
calc_object_states()copied every listed object version into one array (40 bytes per version) and sorted it. On a PG with ~850k objects in an EC 8+2 pool (8.5M versions) this takes about 1.3 s on a desktop CPU and allocates a 340 MB temporary array, and the OSD event loop is blocked all that time: client I/O on the OSD stops and pings go unanswered.Store v1 lists are already made of a few sorted runs (the clean part, the dirty-stable objects appended after it, the unstable part), so this change merges the runs with a heap and checks objects one at a time; the object state walk itself is unchanged. A list segment that is not made of a few sorted runs (the new store lists objects unordered) is sorted on its own first. The merged order is the same as after the full sort.
Measured
calc_object_states()on that PG, 8.5M versions (masterde3644bcagainst this PR, median of 3 runs):osd_peering_pg_test(3 lists of 8M versions, default RelWithDebInfo flags): 3.3 s / 1.8 GB RSS before, 1.3 s / 0.6 GB after.Found: seen on a large cluster under load: peering a PG with about 8.5M object versions kept the OSD event loop busy for 2-4 s, peers dropped the OSD by timeout, and a peering storm followed.
Tested:
osd_peering_pg_testwith a new check that the merged order equals a full sort (200 seeds; sorted, two-part, version-ascending and unordered segments, with tombstones),test_peering_tombstone,osd_test,test_pg_chaos;osd_peering_pg_testandtest_peering_tombstonealso under ASan+UBSan.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
Цифры в описании перемерил на финальном коде PR с одинаковыми флагами сборки (медиана 3 прогонов).
Прежние были сняты с прототипа, а 6,3 с — со сборки с другими флагами.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.