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 718091 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]
Re-factored, and corrects the return type for get_more_nodes
bug-924792.patch (text/plain), 4.08 KB, created by
Alex Wheeler
on 2013-03-29 14:26:52 UTC
(
hide
)
Description:
Re-factored, and corrects the return type for get_more_nodes
Filename:
MIME Type:
Creator:
Alex Wheeler
Created:
2013-03-29 14:26:52 UTC
Size:
4.08 KB
patch
obsolete
>diff --git a/ufo/gluster/swift/common/ring.py b/ufo/gluster/swift/common/ring.py >index 9bac39c..06aab8d 100644 >--- a/ufo/gluster/swift/common/ring.py >+++ b/ufo/gluster/swift/common/ring.py >@@ -37,6 +37,29 @@ if not reseller_prefix.endswith('_'): > reseller_prefix = reseller_prefix + '_' > > class Ring(ring.Ring): >+ def _get_part_nodes(self, part): >+ 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_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. >+ """ >+ return self._get_part_nodes(part) >+ > def get_nodes(self, account, container=None, obj=None): > """ > Get the partition and nodes for an account/container/object. >@@ -63,20 +86,26 @@ 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}] >+ '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 \ >- and not (dev['id'] in seen_ids \ >- or seen_ids.add(dev['id']))] >- if not nodes: >- nodes = false_node >- return part, nodes >+ return part, self._get_part_nodes(part) >+ >+ >+ 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, so yield nothing >+ """ >+ yield self.false_node >diff --git a/ufo/test/unit/common/test_ring.py b/ufo/test/unit/common/test_ring.py >index 4fb964e..920cc3f 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' >+ for node in self.ring.get_more_nodes(0): >+ assert node['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' >+ for node in self.ring.get_more_nodes(0): >+ assert node['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