Show netlink-revived devices in vitastor-nbd ls #209
Open
koolkhel
wants to merge 1 commits from
koolkhel/vitastor:nbd-ls-revive into master
pull from: koolkhel/vitastor:nbd-ls-revive
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:nbd-ls-revive"
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
lslisted a device only when/sys/block/nbdN/pidwas a runningmapornetlink-mapprocess. The kernel sets that pid on CONNECT and keeps it on RECONFIGURE. So afternetlink-reviveit names the dead process, and thenetlink-revivecommand wasn't accepted anyway:lsshowed nothing for a working device. Now such a device is looked up among the runningnetlink-reviveprocesses in/proc.The help and docs said netlink devices never show up in
ls. They now say that the sysfs pid of a revived device stays the old one.This change was the second commit of #155, on top of the backend identifier change. It does not depend on that change, so it comes here on its own and doesn't wait for #155. #155 will be rebased on this PR.
New
tests/test_nbd_netlink_revive.sh(run_tests.sh, and atest.ymljob generated withtests-to-yaml.pl):netlink-map,kill -9of the daemon,netlink-revive, read the data back, thenlsmust show a live server other than the killed one. The test finds the daemon by its command line, not by/sys/block/nbdN/pid, which is a pid of the kernel's pid namespace. So it also works in a container with its own pid namespace. #155 adds its other-image and snapshot steps to this test.Found: seen in a test run (kernel 6.8). After
netlink-map,kill -9of the daemon andnetlink-revive, the device served I/O, butlsprinted nothing.Tested:
tests/test_nbd_netlink_revive.shin a VM (Ubuntu 24.04, kernel 6.8). It fails on master54b8d2c0with "ls doesn't show the revived /dev/nbd0" and passes with this commit. The same holds in a pid namespace of its own (unshare --pid --fork --mount-proc).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.