How do I "push" or "repush" a swift ring?
When I set up my first swift ring, to add the node it was as simple as calling:
$export ZONE=1
$export STORAGE_LOCAL_NET_IP=192.168.0.4
$swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT
WARNING: No region specified for z1-192.168.0.4:6002/sdb1. Defaulting to region 1.
Device d1r1z1-192.168.0.4:6002R192.168.0.4:6002/sdb1_"" with 100.0 weight got id 1
However, if I set the weight to zero, and then remove the node the same way:
$swift-ring-builder account.builder set_weight z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE 0
d1r1z1-192.168.0.4:6002R192.168.0.4:6002/sdb1_"" weight set to 0.0
$swift-ring-builder account.builder remove z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE
d1r1z1-192.168.0.4:6001R192.168.0.4:6001/sdb1_"" marked for removal and will be removed next rebalance.
Then I add the node again - this time with a different zone:
$export ZONE=2
$swift-ring-builder account.builder add z$ZONE-$STORAGE_LOCAL_NET_IP:6002/$DEVICE $WEIGHT
WARNING: No region specified for z2-192.168.0.4:6002/sdb1. Defaulting to region 1.
Device d1r1z2-192.168.0.4:6002R192.168.0.4:6002/sdb1_"" with 100.0 weight got id 1
Then wait the allotted period (1 hour) and rebalance:
$sudo swift-ring-builder account.builder rebalance
I get:
Reassigned 262144 (100.00%) partitions. Balance is now 100.00.
-------------------------------------------------------------------------------
NOTE: Balance of 100.00 indicates you should push this
ring, wait at least 1 hours, and rebalance/repush.
-------------------------------------------------------------------------------
"repush" isn't in man swift-ring-builder.
At first, swift-ring-builder told me that the relationship was 200.00 to -100.00. e.g.
$ swift-ring-builder /etc/swift/account.builder
/etc/swift/account.builder, build version 11
262144 partitions, 3.000000 replicas, 1 regions, 1 zones, 3 devices, 200.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 192.168.0.3 6002 192.168.0.3 6002 sdb1 100.00 786432 200.00
1 1 1 192.168.0.4 6002 192.168.0.4 6002 sdb1 100.00 0 -100.00
2 1 1 192.168.0.5 6002 192.168.0.5 6002 sdb1 100.00 0 -100.00
Then, after a few minutes, it rebalanced it to 100 to -50:
$ swift-ring-builder /etc/swift/account.builder
/etc/swift/account.builder, build version 12
262144 partitions, 3.000000 replicas, 1 regions, 1 zones, 3 devices, 100.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
0 1 1 192.168.0.3 6002 192.168.0.3 6002 sdb1 100.00 524288 100.00
1 1 1 192.168.0.4 6002 192.168.0.4 6002 sdb1 100.00 131072 -50.00
2 1 1 192.168.0.5 6002 192.168.0.5 6002 sdb1 100.00 131072 -50.00 ...