osd: Stabilize unstable writes of a removed pool before stopping its PGs #115
Open
koolkhel
wants to merge 1 commits from
koolkhel/vitastor:pause-sync-before-stop into master
pull from: koolkhel/vitastor:pause-sync-before-stop
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:pause-sync-before-stop"
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
This replaces #106 (#106): instead of each OSD rolling back its own store, the primary stabilizes the writes before it lets the PG go, so only the primary modifies data, as before.
stop_pg()forgets the PG's unstable writes (drop_dirty_pg_connections()) and leaves them to the next primary, which stabilizes or rolls them back during peering. But nobody peers a removed pool again, so its unstable writes stay on the OSDs forever. The old store can't trim its journal past them: the journal fills up and writes to all other pools on the same OSDs fail with -EAGAIN, restarts don't help. Only EC/XOR pools leave such writes, replicated ones write stable.The monitor already pauses PGs of a removed pool and waits for them to go offline before it forgets them (
stop_all_pgs()). Now, when the primary sees its PG paused and the pool gone from/config/pools, it:The sync runs before the PG leaves the active state on purpose: secondaries accept STABILIZE only from the PG lock holder, the locks are released when the PG goes to stopping, and the next primary can't take the PG before this one reports it offline, so there is no race with a new primary's LIST.
Pauses of existing pools (PG count changes) stop at once, exactly as before: their next primaries peer them anyway.
A stuck peer can't block the stop for good: a dead or silent peer is disconnected by the keepalive (
osd_idle_timeout+osd_ping_timeout, 10 s by default), which fails the sync with EPIPE. An operation stuck in a live peer's store holds the stop the same way any in-flight write already holdsstop_pg()(can_stop()needsinflight == 0).Not covered: a primary that is dead when the pool is removed, an OSD that was down during the removal and comes back with unstable writes, a pool whose PGs never become active (incomplete), and a journal that is already full, where the stabilize itself gets -EAGAIN.
Tested:
osd_test: newtest_pause_stabilizes_before_stop,test_unpause_cancels_pause_sync,test_pause_sync_waits_for_inflight_write,test_pause_of_existing_pool_stops_at_oncetests/test_rm_pool_unstable.sh(old store, EC 2+1, writes with autosync off and no client sync, thenrm-pool, then 4x the journal size to another pool): fails on master with "Pool removed: writes to another pool got stuck", passes with the patch, no unstable writes of the removed pool left in the journalstest_change_pg_count.shandtest_change_pg_count_online.sh(EC, also withOLD=1),test_interrupted_rebalance.sh(EC, also withOLD=1),OLD=1 test_move_reappear.sh: pass, no pause syncs for PG count changes. An earlier version that synced on every pause also passed the PG count change tests with up to 105 syncs per run.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.