[swift] Sync rings automatically
The familiar process for ring modification is: 1/ Create or amend corresponding builder file 2/ Rebalance it 3/ (R)sync the newly modified ring to all hosts in the cluster Recently I was wondering about removing the need for 3/. A very simple minded approach would be to make a cron job on each host to periodically rsync from one of the proxies (designated as the 'master' where we modify rings).. However, I then decided that it would be nicer to make a new Swift daemon and add it to the code. I have coded this up (I'm looking at adding a patch to Swift's Gerrit but thought I'd mention it here first). the basic design is: - New daemon swift-ring-syncer - Backend code in common/ring_syncer.py - Conf file ring-syncer.conf One host is designated the authoritative source (config 'ringbuilder'). All hosts can run this daemon (including the ringbuilder), Rings will be rsync'd at a configurable interval (e.g 300s).. This is safe to do even when the rings are being modified as the current code does a temp file write plus atomic rename (If it is desired to sync the builder files too then their 'save' function would need to use this sane logic instead of writing to them directly). Does this sound like something that would be good in the main Swift code? Let me know and I'll setup Gerrit if so! Regards Mark
participants (1)
-
Mark Kirkwood