QA:Testcase Swift Add Device

From FedoraProject

Revision as of 13:43, 17 September 2012 by Derekh (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



Swift allows storage devices to be added to a running swift environment. In this test we will add a storage device to the ring file. And verfiy it is being utilized


So its more likely we'll see the effects of adding a device we upload more data to swift

$> cd
$> . /path/to/keystonerc
$> for x in {1..10} ; do swift upload c$x ; done

Create a new loopback storage device (use a physical device if you have access to one)

$> truncate /var/tmp/swift-storage-newdevice --size 5G
$> DEVICE=$(losetup --show -f  /var/tmp/swift-storage-newdevice)
$> mkfs.ext4 -I 1024 $DEVICE
$> mkdir -p /srv/node/newdevice
$> mount -o noatime,nodiratime,nobarrier,user_xattr $DEVICE /srv/node/newdevice
$> chown -R swift:swift /srv/node/newdevice 

How to test

Add the new device to the ring

$> swift-ring-builder /etc/swift/account.builder add z1- 100
$> swift-ring-builder /etc/swift/container.builder add z1- 100
$> swift-ring-builder /etc/swift/object.builder add z1- 100
$> swift-ring-builder /etc/swift/object.builder pretend_min_part_hours_passed
$> swift-ring-builder /etc/swift/account.builder pretend_min_part_hours_passed
$> swift-ring-builder /etc/swift/container.builder pretend_min_part_hours_passed

test for files on the new device (there should be none

$> find /srv/node/newdevice -type f

re-balance the ring file

$> swift-ring-builder /etc/swift/account.builder rebalance
$> swift-ring-builder /etc/swift/container.builder rebalance
$> swift-ring-builder /etc/swift/object.builder rebalance

Expected Results

After a sort wait some files should be moved from the other devices to the new storage device

$> find /srv/node/newdevice -type f