31 Commits

Author SHA1 Message Date
Greg Lange
44f00a23c1 fixed some minor things in tests that pyflakes complained about
Change-Id: Ifeab56a964630bcf941e932fcbe39e6572e62975
2013-03-26 20:42:26 +00:00
David Hadas
a979c8007b Add support for Hash Prefix
A new configuration parameter is added to /etc/swift/swift.conf
[swift-hash]
swift_hash_path_prefix = 'random unique string'

New installations are advised to set this parameter to a random secret,
which would not be disclosed ouside the organization.
The same secret needs to be used by all swift servers of the same cluster.

Existing installations should set this parameter to an empty string
(the default)

DocImpact

Fixes: Bug #1157454

Change-Id: I63b10d0b7d6dd3f74e0f10bb41b5f240fa03578a
2013-03-22 19:41:55 +02:00
Joe Gordon
45f0502b52 Fix spelling mistakes
git ls-files | misspellings -f -
Source: https://github.com/lyda/misspell-check

Change-Id: I4132e6a276e44e2a8985238358533d315ee8d9c4
2013-02-12 16:39:40 -08:00
gholt
95d5cf851b Fixed bug in object replicator
If the object replicator couldn't create a device's object directory
(due to permissions or whatever) it wouldn't do any work at all. This
fixes that.

Change-Id: I6a30439d036b29c9cfdb660428d13668e0dc8632
2013-01-12 07:25:15 +00:00
Darrell Bishop
ea95d0092a Avoid infinite recursion in swift.obj.replicator.get_hashes.
Fixes bug 1089140.

Turns out that if an exception bails out of the pickle loading (eg.
zero-byte hahes_file), the if clause to determine whether or not to
write out a fresh hashes_file can evaluate to false, leading to an
infinite loop.

This patch fixes this infinite loop generally, by ensuring that if any
exception is thrown, a new hashes_file is written.

Change-Id: I344c5f8e261ce7c667bdafe1687263a4150b21dc
2012-12-11 15:32:09 -08:00
David Goetz
a6c44d2764 allow replicator run_once to check specific devices/partitions
Change-Id: If45f77fda269ae6e251579542e70eb71bd11fe2a
2012-09-28 12:24:15 -07:00
David Goetz
d24e280bf4 obj replicator speed up
Change-Id: If02b573353dedea9c2368ce4733fe97599229b2e
2012-09-10 15:12:39 -07:00
Darrell Bishop
46a093f068 Obj replicator cleans up files where part dirs should be.
If a partition directory was a file instead of a directory, the
object-replicator would attempt to listdir() it, raise an exception, and
try again next iteration.  This condition could arise after running
xfs_repair.

Now, collect_jobs() will reap any partition directories which are
actually files.  Fixes bug 1045954.

Change-Id: Id65d3eab2effd61c3f6b25250611c88c907b2a16
2012-09-05 23:54:16 +00:00
Michael Barton
da0e013d98 make obj replicator locking more optimistic
Basically, do all hashing in the replicator without a lock, then
lock briefly to rewrite the hashes file. Retry if someone else has
modified the hashes file in the mean time (which should be rare).

Also, a little refactoring.

Change-Id: I6257a53808d14b567bde70d2d18a9c58cb1e415a
2012-08-22 13:09:35 -07:00
Ionuț Arțăriși
9af3df9ee8 fix object replication on older rsync versions when using ipv4
Fixes bug 987388

Change-Id: I6eb5c45fe1f5844ad853a4ff9bc8fd23cc9abd5d
2012-06-06 10:07:56 +02:00
Samuel Merritt
bb509dd863 As-unique-as-possible partition replica placement.
This commit introduces a new algorithm for assigning partition
replicas to devices. Basically, the ring builder organizes the devices
into tiers (first zone, then IP/port, then device ID). When placing a
replica, the ring builder looks for the emptiest device (biggest
parts_wanted) in the furthest-away tier.

In the case where zone-count >= replica-count, the new algorithm will
give the same results as the one it replaces. Thus, no migration is
needed.

In the case where zone-count < replica-count, the new algorithm
behaves differently from the old algorithm. The new algorithm will
distribute things evenly at each tier so that the replication is as
high-quality as possible, given the circumstances. The old algorithm
would just crash, so again, no migration is needed.

Handoffs have also been updated to use the new algorithm. When
generating handoff nodes, first the ring looks for nodes in other
zones, then other ips/ports, then any other drive. The first handoff
nodes (the ones in other zones) will be the same as before; this
commit just extends the list of handoff nodes.

The proxy server and replicators have been altered to avoid looking at
the ring's replica count directly. Previously, with a replica count of
C, RingData.get_nodes() and RingData.get_part_nodes() would return
lists of length C, so some other code used the replica count when it
needed the number of nodes. If two of a partition's replicas are on
the same device (e.g. with 3 replicas, 2 devices), then that
assumption is no longer true. Fortunately, all the proxy server and
replicators really needed was the number of nodes returned, which they
already had. (Bonus: now the only code that mentions replica_count
directly is in the ring and the ring builder.)

Change-Id: Iba2929edfc6ece89791890d0635d4763d821a3aa
2012-05-09 15:56:06 -07:00
Jenkins
6682138b0a Merge "Make ring class interface slightly more abstracted from implementation." 2012-03-22 20:25:06 +00:00
John Dickinson
1ecf5ebba1 updated copyright date for all files
Change-Id: Ifd909d3561c2647770a7e0caa3cd91acd1b4f298
2012-03-19 13:45:34 -05:00
Michael Barton
e008c2ebb8 Make ring class interface slightly more abstracted from implementation.
Change-Id: I0f55d61c7b8de30460f17a69e5d9946494dbda6e
2012-03-14 22:00:30 +00:00
David Goetz
2b3aab86bb Fix object replicator to handle Timeouts fixes: lp 814263
Change-Id: I4c8b73d4cb0540fa105f240b2a9d481cf9c1e55c
2011-11-28 11:24:22 -08:00
gholt
dfd61697c1 Fix bug; added test for quarantined a hash dir that becomes a file 2011-08-02 17:46:17 +00:00
gholt
ae5cc4f6ce Fix test to compare unpickled values since we really don't care to test pickling 2011-07-25 08:40:11 -07:00
Michael Barton
dc213d9746 update unit tests 2011-05-13 02:41:37 +00:00
David Goetz
b544570da5 merge to trunk conflicts 2011-03-28 19:29:20 -07:00
Michael Barton
765f5b5c3f refactor obj-rep a bit and move hash recalculate to before rsync step 2011-03-20 22:14:03 +00:00
David Goetz
5482035bc0 change ite logic and add more tests 2011-03-16 07:55:07 -07:00
David Goetz
86c84c3bc3 unittests workng and added probe test 2011-03-15 22:12:03 -07:00
Clay Gerrard
c1e09d35be fix ring hash check fix in obj replicator tests 2011-03-08 14:23:31 -06: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
David Goetz
dcd3743def adding temp dir thing 2010-11-16 11:06:39 -08:00
David Goetz
aed24cf328 changes from code review 2010-11-16 08:32:03 -08:00
David Goetz
a71164995a adding tests and splitting out collect jobs 2010-11-05 09:15:31 -07:00
David Goetz
2cb61902a3 adding extra tests and suffix hash bug fix 2010-11-03 16:08:13 -07:00
David Goetz
9c44bb224f adding run_once unit test 2010-10-29 15:26:35 -07:00
Chuck Thier
158e6c3ae9 refactored bins to by more DRY 2010-08-31 23:12:59 +00:00
Chuck Thier
001407b969 Initial commit of Swift code 2010-07-12 17:03:45 -05:00