osd: Fix an endless retry of a chained read when the object state goes away #167
Open
koolkhel
wants to merge 2 commits from
koolkhel/vitastor:chain-read-eio-loop into master
pull from: koolkhel/vitastor:chain-read-eio-loop
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:chain-read-eio-loop"
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
A chained read (a clone or a snapshot child) keeps the object state of each layer it reads in
chain_states[].submit_chained_read_requests()refreshed it only while the PG was not exactlyPG_ACTIVE, and the replicated bitmap fast path doesn't refresh it either.So when the parent object is the last unclean object of its PG and its recovery finishes while the read subop is in flight, the PG becomes
PG_ACTIVEand the kept pointer is stale (the state is already freed). If the local copy then answers EIO,check_corrupted_chained()passes the stale pointer tomark_object(), which sees a changed state and skips the mark, and the unconditional retry incontinue_chained_read()reads the same copy again. The client op never finishes; the OSD re-reads the object back to back until the PG state changes.Fix: take the state of every read layer through
get_object_osd_set()on each attempt. In a clean PG it returns NULL andcur_set, so the read target is the same as before. The read then marks the failing copy on the next EIO and reads the other one.collect_bitmap_requests()takes every layer's state on each attempt, so a vanished state costs at most one extra round there.capturing_bs_t::read_bitmap()in the fixture, as #158 does; whichever of the two goes in second, I'll rebase it.Tested: new
test_chained_read_eio_after_recovery_finishesinosd_test(replicated PG; recovery of the parent object finishes while the chained read is in flight; the local copy keeps answering EIO). Without the fix the read is still retrying after 10 EIO answers (also after 1000); with it the read is served from the other OSD after 2. The wholeosd_testpasses.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.