swift-proxy _get_zone breaks when replicas value is the same as the number of swift-storage block-devices

Bug #1342891 reported by Ryan Harper
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
swift-proxy (Juju Charms Collection)
Fix Released
Medium
Unassigned

Bug Description

deploying swift-proxy and swift-storage like this:

    swift-proxy:
      branch: lp:charms/swift-proxy
      options:
        replicas: 3
        swift-hash: fdfef9d4-8b06-11e2-8ac0-531c923c8fae
        use-https: 'no'
        zone-assignment: auto
    swift-storage:
      branch: lp:charms/swift-storage
      num_units: 3
      options:
        block-device: /mnt/swift1.img|2G /mnt/swift2.img|2G /mnt/swift3.img|2G
        overwrite: 'true'
        zone: 1

Results in successful deployment, but swift-storage services won't start due to missing swift-hash.
swift-hash isn't set/sent because all storage nodes are put into the same zone.

This is a result of a bug in swift-proxy/hooks/swift_utils.py:_get_zone() not handling multiple devices, and the edge case where the number of devices in the block-device list matches the replicas value.

The algorithm doesn't account for a single storage node having multiple devices; this confuses the distribution logic.

tags: added: cloud-installer
Revision history for this message
Ryan Harper (raharper) wrote :

Applied this fix to linked branch.

This resolves the issue for the included deployment yaml. Could use more testing.

Revision history for this message
James Page (james-page) wrote :

I've pushed to /next where this will get more testing.

Changed in swift-proxy (Juju Charms Collection):
importance: Undecided → Medium
status: New → Triaged
status: Triaged → Fix Committed
tags: added: landscape
Revision history for this message
Adam Collard (adam-collard) wrote :

Can we get this backported to /stable please?

Revision history for this message
James Page (james-page) wrote :

Stable update proposed.

James Page (james-page)
Changed in swift-proxy (Juju Charms Collection):
status: Fix Committed → Fix Released
Revision history for this message
Philip S. Hempel (pshempel) wrote :

This below configuration fails still, will not pass swift_hash and there for does not start any services, using trusty release

swift-proxy:
  zone-assignment: 'manual'
  replicas: 3
  swift-hash: '59cad785-a091-beef-abbf-7d0e81064336'
  vip: '192.168.99.12'
  vip_cidr: 19
  ha-bindiface: br0
swift-hacluster:
  corosync_bindiface: br0
swift-storage-z1:
  zone: 1
  block-device: '/dev/sdb /dev/sdc /dev/sdd /dev/sde'
swift-storage-z2:
  zone: 2
  block-device: '/dev/sdb /dev/sdc /dev/sdd /dev/sde'
swift-storage-z3:
  zone: 3
  block-device: '/dev/sdb /dev/sdc /dev/sdd /dev/sde'

The swift.conf file is still empty

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.