osd: Don't exit on finding own state key, arm lease timers only after the grant #186

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:osd-own-lease-stats-timer into master

2 Commits

Author SHA1 Message Date
8483f86940 Drop test_osd_state_reply_lost from the PR as asked in review 2026-11-25 22:48:25 +03:00
b48607b7f1 osd: Don't exit on finding own state key, arm lease timers only after the grant
When the reply to the /osd/state creation transaction was lost (timeout)
but etcd applied it, the retry found the key with the OSD's own lease
and the OSD exited with "already exists, OSD N is still up". Treat a key
holding our own lease as created.

acquire_lease() armed the periodic renewal and statistics timers on every
call, so each failed lease grant added one more of each. Arm them once,
when the lease is granted.
2026-11-25 09:22:10 +03:00