Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 717392 Details for
Bug 924792
Gluster-swift does not allow operations on multiple volumes concurrently.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Added more test coverage
bug-924792.patch.txt (text/plain), 3.71 KB, created by
Alex Wheeler
on 2013-03-28 01:41:39 UTC
(
hide
)
Description:
Added more test coverage
Filename:
MIME Type:
Creator:
Alex Wheeler
Created:
2013-03-28 01:41:39 UTC
Size:
3.71 KB
patch
obsolete
>diff --git a/ufo/gluster/swift/common/ring.py b/ufo/gluster/swift/common/ring.py >index 9bac39c..fd6aae5 100644 >--- a/ufo/gluster/swift/common/ring.py >+++ b/ufo/gluster/swift/common/ring.py >@@ -63,20 +63,52 @@ class Ring(ring.Ring): > hardware description > ====== =============================================================== > """ >- false_node = [{'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', 'id': 0, \ >+ self.false_node = [{'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', 'id': 0, \ > 'meta': '', 'device': 'volume_not_in_ring', \ > 'port': 6012}] > if account.startswith(reseller_prefix): >- acc_name = account.replace(reseller_prefix, '', 1) >+ self.acc_name = account.replace(reseller_prefix, '', 1) > else: >- acc_name = account >+ self.acc_name = account > > part = 0 > seen_ids = set() > nodes = [dev for dev in self._devs \ >- if dev['device'] == acc_name \ >+ if dev['device'] == self.acc_name \ > and not (dev['id'] in seen_ids \ > or seen_ids.add(dev['id']))] > if not nodes: >- nodes = false_node >+ nodes = self.false_node > return part, nodes >+ >+ def get_part_nodes(self, part): >+ """ >+ Get the nodes that are responsible for the partition. If one >+ node is responsible for more than one replica of the same >+ partition, it will only appear in the output once. >+ >+ :param part: partition to get nodes for >+ :returns: list of node dicts >+ >+ See :func:`get_nodes` for a description of the node dicts. >+ """ >+ seen_ids = set() >+ nodes = [dev for dev in self._devs \ >+ if dev['device'] == self.acc_name \ >+ and not (dev['id'] in seen_ids \ >+ or seen_ids.add(dev['id']))] >+ if not nodes: >+ nodes = self.false_node >+ return nodes >+ >+ def get_more_nodes(self, part): >+ """ >+ Generator to get extra nodes for a partition for hinted handoff. >+ >+ :param part: partition to get handoff nodes for >+ :returns: generator of node dicts >+ >+ See :func:`get_nodes` for a description of the node dicts. >+ Should never be called in the swift UFO environment >+ """ >+ return self.false_node >diff --git a/ufo/test/unit/common/test_ring.py b/ufo/test/unit/common/test_ring.py >index 4fb964e..404a691 100644 >--- a/ufo/test/unit/common/test_ring.py >+++ b/ufo/test/unit/common/test_ring.py >@@ -34,10 +34,24 @@ class TestRing(unittest.TestCase): > try: > __devs = self.ring._devs > self.ring._devs = _mock_ring_data() >+ > part, node = self.ring.get_nodes('test') > assert node[0]['device'] == 'test' >+ node = self.ring.get_part_nodes(0) >+ assert node[0]['device'] == 'test' >+ node = self.ring.get_more_nodes(0) >+ assert node[0]['device'] == 'volume_not_in_ring' >+ > part, node = self.ring.get_nodes('test2') >- assert node >+ assert node[0]['device'] == 'volume_not_in_ring' >+ node = self.ring.get_part_nodes(0) >+ assert node[0]['device'] == 'volume_not_in_ring' >+ >+ part, node = self.ring.get_nodes('AUTH_iops') >+ assert node[0]['device'] == 'iops' >+ node = self.ring.get_part_nodes(0) >+ assert node[0]['device'] == 'iops' >+ node = self.ring.get_more_nodes(0) > assert node[0]['device'] == 'volume_not_in_ring' > finally: > self.ring._devs = __devs
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 924792
:
717356
|
717381
|
717392
|
718091
|
718100