osd: Return the stored bitmap for secondary reads sent without attr_len #227
Open
koolkhel
wants to merge 1 commits from
koolkhel/vitastor:sec-read-bitmap-attr-len-0 into master
pull from: koolkhel/vitastor:sec-read-bitmap-attr-len-0
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:sec-read-bitmap-attr-len-0"
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
Since
51ecbadb("Only update bitmaps when writing data in primary subops") a secondary OSD passes no bitmap to the blockstore whenattr_lenis 0 (exec_secondary_real,src/osd/osd_secondary.cpp:203). That is right for writes. But the SEC_READ reply still carriesattr_len = clean_entry_bitmap_sizeandcur_op->bitmap(osd_secondary.cpp:29, sent bymsgr_send.cpp), and that buffer is now never filled.Current primaries always send reads with
attr_len = clean_entry_bitmap_size(submit_primary_subop), so they are not affected. Primaries without51ecbadb(3.0.13 and older) send every read withattr_len = 0and take the unfilled buffer as the part's bitmap. So while old and new OSDs serve the same PGs during a rolling upgrade:assert(stripes[role].read_buf)insend_chained_read_results;The fix keeps "no
attr_len, no bitmap" for SEC_WRITE / SEC_WRITE_STABLE only. SEC_READ always passes its (always allocated) bitmap buffer to the blockstore, as before51ecbadb. Read-with-bitmap is the path local primary reads already take. The reply format does not change.Found: seen in a run. On a cluster in the middle of a rolling upgrade, primaries running the old version repeatedly crashed on the
stripes[role].read_bufassert insend_chained_read_resultswhile new OSDs were in their PGs. The cause was traced in the code and reproduced by the unit test below, not on a mixed-version cluster.Tested: osd_test. The new
test_sec_read_without_attr_len_returns_bitmapsends SEC_READ to a secondary withattr_len = 0and withattr_len = 4and checks that the reply carries the stored bitmap. It fails without the fix (Assertion '!memcmp(reply->bitmap, &stored_bmp, sizeof(stored_bmp))' failed) and passes with it, as does the rest of osd_test.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.