18 Commits

Author SHA1 Message Date
Kun Huang
cb69dc881a Give friendly notification in swift-get-nodes
Hard coding of '/srv/node' maybe drive to some errors. But it seems
unfixable (please see talks in bug report). To avoid erros as we can,
showing a friendly notification to let user set their own device
location works better than hard coding directly.

Change-Id: I45d749dd52af8d3b051dfe98dbb9d71a5a374f97
Fixes: bug #907908
2013-03-09 13:43:54 +08:00
Samuel Merritt
7548cb9c47 Make rings' replica counts adjustable.
Example:

$ swift-ring-builder account.builder set_replicas 4
$ swift-ring-builder rebalance

This is a prerequisite for supporting globally-distributed clusters,
as operators of such clusters will probably want at least as many
replicas as they have regions. Therefore, adding a region requires
adding a replica. Similarly, removing a region lets an operator remove
a replica and save some money on disks.

In order to not hose clusters with lots of data, swift-ring-builder
now allows for setting of fractional replicas. Thus, one can gradually
increase the replica count at a rate that does not adversely affect
cluster performance.

Example:

$ swift-ring-builder object.builder set_replicas 3.01
$ swift-ring-builder object.builder rebalance
<distribute rings and wait>

$ swift-ring-builder object.builder set_replicas 3.02
$ swift-ring-builder object.builder rebalance
<distribute rings and wait>...

Obviously, fractional replicas are nonsensical for a single
partition. A fractional replica count is for the whole ring, not for
any individual partition, and indicates the average number of replicas
of each partition. For example, a replica count of 3.2 means that 20%
of partitions have 4 replicas and 80% have 3 replicas.

Changes do not take effect until after the ring is rebalanced. Thus,
if you mean to go from 3 replicas to 3.01 but you accidentally type
2.01, no data is lost.

Additionally, 'swift-ring-builder X.builder create' can now take a
decimal argument for the number of replicas.

DocImpact

Change-Id: I12b34dacf60350a297a46be493d5d171580243ff
2013-02-22 15:03:10 -08:00
David Goetz
ded504600f Allow actual paths to work for swift-get-nodes
Change-Id: I29f9ab73c8ca2a3c52247fb92ef951dd5b5246cb
2013-01-04 13:48:15 -08:00
Samuel Merritt
35f4d29ed6 Upgrade pep8 to 1.3.3.
This required a bunch of whitespace-poking of the scripts in bin, but
that's all. Now every file in swift/ and bin/ is pep8-1.3.3-compliant,
so hopefully we can be done with this pep8 stuff for a good long time.

Change-Id: I44fdb41d219c57400a4c396ab7eb0ffa9dcd8db8
2012-11-26 18:15:21 -08:00
gholt
e415e4d235 Added partition option to swift-get-nodes
Sometimes you just want to know what machines a given partition
should be on, or what handoffs that partition would use if needed.
We've been meaning to add this option to swift-get-nodes for quite
some time, but I just finally got to it.

Example: swift-get-nodes /etc/swift/object.ring.gz -p 123

I tried to leave as much of the existing swift-get-nodes unaltered,
so the output isn't exactly distilled to just what you'd need for
getting a partition's nodes. But it should suffice for what it is, an
admin tool.

Change-Id: I438400ddc0eecbf9c48266e7f38a2e4f0765f374
2012-10-25 17:47:01 +00:00
Samuel Merritt
67af56b156 Make swift-get-nodes -a show all handoffs.
Commit 95786e5 made swift-get-nodes only output N handoff nodes, where
N is the ring's replica count. This change leaves that behavior in
place as the default, but adds the option -a/--all to print all the
handoff nodes.

This is handy if you're consuming the output with a script, e.g. if
you're doing some analysis of the distribution of primary+handoff
nodes for a particular set of things.

Change-Id: Ie0253575bb21ccf25559a1c5fd20570a58a2d9fa
2012-06-20 12:45:34 -07:00
gholt
95786e577c Update swift-get-nodes to return fewer more_nodes
Changed swift-get-nodes to just return up to replica_count of
more_nodes instead of all of them. When you have thousands of drives,
returning all possible handoff nodes is pretty crazy. :)

Change-Id: I864e7243726ca3ef2ac08c4ab660a05789f37878
2012-06-13 01:56:43 +00:00
Samuel Merritt
8e6f099daa Speed up swift-get-nodes by 2x.
It was loading the ring off disk once to print the primary nodes, and
then loading the whole thing off disk again to print the handoff
nodes. Changed it to only load the ring off disk once.

Change-Id: I6f4cd0af9762e1e69660c3eb20586590b5339e5f
2012-05-10 00:10:24 -07:00
John Dickinson
1ecf5ebba1 updated copyright date for all files
Change-Id: Ifd909d3561c2647770a7e0caa3cd91acd1b4f298
2012-03-19 13:45:34 -05:00
David Goetz
51ce438f7f changing /usr/bin/python to /usr/bin/env python 2011-03-24 15:51:44 -07:00
Anne Gentle
8823427161 Changed copyright notices on py files and the single rst file with a copyright notice 2011-01-04 17:34:43 -06:00
gholt
57970bdeb5 Cleaned up the bins; patched the broken test (when run standalone) 2010-12-29 12:00:08 -08:00
Michael Barton
f432269013 add gettext to all binaries 2010-12-22 17:18:30 +00:00
Jay Payne
013194b71b corrected dir order and spelling errors in ls section 2010-09-17 15:54:05 +00:00
Jay Payne
12d8f14891 Fixed pep8 errors, dir error in the listing, made dryer 2010-09-16 13:54:17 +00:00
Jay Payne
cbbfb80f86 Clean up code that was requested 2010-09-15 19:28:57 +00:00
Jay Payne
e61c21b98f Adds HandOff locations to the various displays 2010-09-14 06:51:20 +00:00
Monty Taylor
76e6c6ea6c Renamed bin files in the tree so that setup.py install does the same thing
as a deb install.
2010-07-14 09:58:38 -05:00