Fix rm-data waiting forever when PGs go inactive during deletion #203
Open
koolkhel
wants to merge 2 commits from
koolkhel/vitastor:delete-wait-up-timer into master
pull from: koolkhel/vitastor:delete-wait-up-timer
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:delete-wait-up-timer"
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
An operation with
OSD_OP_WAIT_UP_TIMEOUTthat finds its PG inactive gets a deadline (wait_up_until), but incontinue_rw()the retry timer is armed only for parts retried after a failure (PART_RETRY). An operation that first found its PG already inactive was left without a timer, so its deadline was checked only when something else woke the client, and it waited for an unrelated event instead of failing afterclient_wait_up_timeout.rm-data hit this when OSDs died during deletion: the deletes in flight at that moment timed out after
client_wait_up_timeout(Failed to remove object ... (retval=-110), one per PG), and the following deletes of the same PGs waited forever. The change arms the retry timer forclient_wait_up_timeoutwherewait_up_untilis set, and re-arms it for the remaining time while the operation still waits:reset_retry_timer()keeps a shorter timer that is already set (in rm-data, the retries of the deletes that were in flight), and after that one fires nothing else would wake the waiting operation before its deadline.rm-data also stops sending deletes to a PG after one of them times out, and adds the PG to the inactive PG list, so it doesn't wait
client_wait_up_timeoutagain for each remaining object of the PG (with the timer alone, a PG with many objects would takeobjects / iodepth * client_wait_up_timeout). Such a PG is reported in the existing "deletion is not complete: PG ..." line and ininactive_pgsof the JSON output; the line's "Failed to list some PGs" prefix is kept as is, so nothing parsing it changes.This doesn't add a time limit to EIO retries: only operations that already carry
OSD_OP_WAIT_UP_TIMEOUT(rm-data and merge) are affected, and only while their PG is inactive.Independent of #201 (the same kind of missing timer, in PG listing).
Found: seen in a run — image removal (
vitastor-cli rm, which runs rm-data) hung on a test cluster after 2 of 5 OSDs were killed with SIGKILL during deletion (one timed out delete per PG, then no progress); reproduced in 2 of 2 runs with--iodepth 1 --parallel_osds 1.Tested: test_cluster_client (new
test_wait_up_timeout_inactive_pg, with a second delete that starts waiting 0.5 s after the first, fails without the client change and also without the re-arm, passes with it, and drives the timer by the real time that passed, so a stall of the test can't fail it); image removal with 2 of 5 OSDs killed during deletion on a 5-OSD cluster in containers, replicated pool 3/2, 32 PGs: before — hung (killed after 120 s), after — exits with an error and the PGs left undeleted named, 18 s after the kill.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
@@ -1243,2 +1243,3 @@}if (op->parts[i].flags & PART_RETRY)// An operation waiting for its PG to come up needs the timer to see wait_up_until expireif ((op->parts[i].flags & PART_RETRY) || op->wait_up_until.tv_sec)Это какое-то смешение механизмов
Идея wait_up_until в том чтобы операция сдохла через это время
Ну то есть да, reset_retry_timer наверное правильно дёрнуть, но не тут а просто когда ставим // Set wait_up timer
К
src/client/cluster_client.cpp:1245: перенёс в0219f6f6—reset_retry_timer(client_wait_up_timeout*1000)теперь там, где ставитсяwait_up_until,retry_afterбольше не трогаю; плюс пока операция ждёт, перевзвожу таймер на остаток срока:reset_retry_timer()оставляет уже взведённый более короткий таймер, и после его срабатывания для других операций (в rm-data это повторы удалений, бывших в пути при отказе OSD) эту никто не будит — тест теперь с двумя удалениями и без перевзвода падает.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.