23c7a58f8f1412c28b3a16b79be09c224c9f7d55
Commit Graph

5143 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Hisashi Osanai
23c7a58f8f Fix ClientException handling in Container Sync
swift/container/sync.py uses swift.common.internal_client.delete_object
and put_object and expected these methods raise ClientException.
But delete_object and put_object never raise the exception so this patch
raises ClientException when urllib2 library raises HTTPError.
Co-Authored-By: Eran Rom <eranr@il.ibm.com>
Closes-Bug: #1419901
Change-Id: I58cbf77988979a07998a46d9d81be84d29b0d9bf
2016年01月07日 10:17:20 +00:00
Jenkins
0553d9333e Merge "Put part-replicas where they go" 2015年12月10日 00:51:52 +00:00
John Dickinson
70bc3d1a3a added a few ruby clients to associated projects
Change-Id: I4764ba505646949ff694f8939947f83c6940128a
2015年12月08日 16:08:04 -08:00
Clay Gerrard
7035639dfd Put part-replicas where they go
It's harder than it sounds. There was really three challenges.
Challenge #1 Initial Assignment
===============================
Before starting to assign parts on this new shiny ring you've
constructed, maybe we'll pause for a moment up front and consider the
lay of the land. This process is called the replica_plan.
The replica_plan approach is separating part assignment failures into
two modes:
 1) we considered the cluster topology and it's weights and came up with
 the wrong plan
 2) we failed to execute on the plan
I failed at both parts plenty of times before I got it this close. I'm
sure a counter example still exists, but when we find it the new helper
methods will let us reason about where things went wrong.
Challenge #2 Fixing Placement
=============================
With a sound plan in hand, it's much easier to fail to execute on it the
less material you have to execute with - so we gather up as many parts
as we can - as long as we think we can find them a better home.
Picking the right parts for gather is a black art - when you notice a
balance is slow it's because it's spending so much time iterating over
replica2part2dev trying to decide just the right parts to gather.
The replica plan can help at least in the gross dispersion collection to
gather up the worst offenders first before considering balance. I think
trying to avoid picking up parts that are stuck to the tier before
falling into a forced grab on anything over parts_wanted helps with
stability generally - but depending on where the parts_wanted are in
relation to the full devices it's pretty easy pick up something that'll
end up really close to where it started.
I tried to break the gather methods into smaller pieces so it looked
like I knew what I was doing.
Going with a MAXIMUM gather iteration instead of balance (which doesn't
reflect the replica_plan) doesn't seem to be costing me anything - most
of the time the exit condition is either solved or all the parts overly
aggressively locked up on min_part_hours. So far, it mostly seemds if
the thing is going to balance this round it'll get it in the first
couple of shakes.
Challenge #3 Crazy replica2part2dev tables
==========================================
I think there's lots of ways "scars" can build up a ring which can
result in very particular replica2part2dev tables that are physically
difficult to dig out of. It's repairing these scars that will take
multiple rebalances to resolve.
... but at this point ...
... lacking a counter example ...
I've been able to close up all the edge cases I was able to find. It
may not be quick, but progress will be made.
Basically my strategy just required a better understanding of how
previous algorithms were able to *mostly* keep things moving by brute
forcing the whole mess with a bunch of randomness. Then when we detect
our "elegant" careful part selection isn't making progress - we can fall
back to same old tricks.
Validation
==========
We validate against duplicate part replica assignment after rebalance
and raise an ERROR if we detect more than one replica of a part assigned
to the same device.
In order to meet that requirement we have to have as many devices as
replicas, so attempting to rebalance with too few devices w/o changing
your replica_count is also an ERROR not a warning.
Random Thoughts
===============
As usual with rings, the test diff can be hard to reason about -
hopefully I've added enough comments to assure future me that these
assertions make sense.
Despite being a large rewrite of a lot of important code, the existing
code is known to have failed us. This change fixes a critical bug that's
trivial to reproduce in a critical component of the system.
There's probably a bunch of error messages and exit status stuff that's
not as helpful as it could be considering the new behaviors.
Change-Id: I1bbe7be38806fc1c8b9181a722933c18a6c76e05
Closes-Bug: #1452431 
2015年12月07日 16:06:42 -08:00
Jenkins
b3d6fa1319 Merge "Replace string slicing with proper string methods" 2015年12月07日 10:37:10 +00:00
Jenkins
1abc353e64 Merge "Add functional test for repeated SLO segments" 2015年12月07日 02:38:05 +00:00
Tushar Gohad
b63caf4521 Bump PyECLib requirement to >=1.0.7
... to match global-requirements. This is an
intermediate step in updating requirements to
PyECLib>=1.1.1.
Change-Id: I79f47fff6ec1adff214ca435f0d95aaf1ffd68f9
2015年12月03日 07:00:14 -07:00
Jenkins
3c7dbf32b1 Merge "Added unit tests to recon.py." 2015年12月03日 00:57:57 +00:00
Christian Schwede
73ded056af Add functional test for repeated SLO segments
Currently fails on master, passes with change
If13af444ed301ebd8fd34a0d96a330ded648f0c4 applied.
Change-Id: I05b231cc232d5b4117bccee40eebc7093114c61c
2015年12月02日 07:58:20 +00:00
Jenkins
620edc631b Merge "Fix crash when a SLO repeats a segment." 2015年12月02日 02:49:52 +00:00
Jenkins
418f9b21ce Merge "Test for content-type params in multi-range response" 2015年12月01日 17:43:23 +00:00
Jenkins
08f8e235b9 Merge "Fix Python 3 issues in utils" 2015年12月01日 06:01:45 +00:00
Jenkins
7785e5ac35 Merge "Add config sample reference to KeystoneAuth docs" 2015年12月01日 05:46:30 +00:00
Jenkins
604cc2d63e Merge "add sample proxy pipeline for keystone integration" 2015年12月01日 03:36:34 +00:00
John Dickinson
679e6d5251 Add config sample reference to KeystoneAuth docs
Change-Id: I38a7bd7b85de9d674386d75220b31cc467746da8
2015年11月30日 11:58:40 -08:00
John Dickinson
5eaa5543c7 add sample proxy pipeline for keystone integration
Change-Id: I4b4fd9179d0234f001940e215c97d40a2a6204cd
2015年11月30日 10:47:19 -08:00
Tim Burke
8e5b38b1dd Expose tempurl's header restrictions via /info
Also, clean up the module documentation a bit.
Change-Id: Iaeb5eb264b118b78738187db9242540275e77444
2015年11月30日 01:50:54 -08:00
Jenkins
0db4fa0a21 Merge "Add functional test for multi-range GET requests." 2015年11月27日 13:50:15 +00:00
Ferenc Horváth
635bc7fa8f Replace string slicing with proper string methods
Updated string prefix and suffix checker slicing to startswith()
and endswith() methods.
Using startswith() and endswith() improves readability, error-proneness
and enhances maintainability.
Change-Id: I1d5fbf116a61763346c6f92fd8023dbbe9bb37cf
2015年11月27日 14:09:35 +01:00
Jenkins
6742c3aab1 Merge "Log error if a local device not identified in replicator" 2015年11月26日 15:14:05 +00:00
Jenkins
1a28ccd01d Merge "Have versioned_writes use reverse listings" 2015年11月26日 14:58:33 +00:00
Alistair Coles
6c43bdc82b Test for content-type params in multi-range response
Updates the functional test to verify the fix applied by
change Iff7274aa631a92cd7332212ed8b4378c27da4a1f
Change-Id: Iae63ac027e4f4acfe46a36dc1325888b1f834ea4
2015年11月26日 14:57:16 +00:00
Samuel Merritt
b339e529c3 Add functional test for multi-range GET requests.
Change-Id: I9d417faede707e4f3570074e410344cc8955007b
2015年11月26日 14:47:16 +00:00
Jenkins
ea3a0d38c1 Merge "Include params in multipart message part content-type" 2015年11月26日 04:41:53 +00:00
Jenkins
72ea23f590 Merge "Add more functional tests for reverse listings" 2015年11月26日 04:40:02 +00:00
Jenkins
b37205fe2d Merge "Improve swift-init usage statement" 2015年11月26日 01:43:28 +00:00
Samuel Merritt
c28709f8f2 Fix crash when a SLO repeats a segment.
If a SLO manifest specified the same segment twice with no range on
the latter, we would crash while trying to coalesce the segment
specifications into a single request (for efficiency). Now we handle
that missing range and do the right thing.
Change-Id: If13af444ed301ebd8fd34a0d96a330ded648f0c4
2015年11月25日 17:17:44 -08:00
Alistair Coles
ad722b3ed3 Include params in multipart message part content-type
The content-type header inserted into a multipart message part
is missing any params such as charset because its value is being
fetched via the swob.Response content_type property, which conforms
to webob spec and strips off all params.
This was noticed in work on feature/crypto branch because the crypto
meta param was being stripped off content-type in multipart messages,
preventing the content-type being decrypted. But in general there is
no suggestion in the multipart message spec [1] that params should
not be included. In fact examples in [1] show the charset param
included in the content-type value.
To ensure that the multipart message part content-type includes the
original content-type params, fetch it directly from the response
headers.
[1] http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
Change-Id: Iff7274aa631a92cd7332212ed8b4378c27da4a1f
2015年11月25日 18:57:48 +00:00
Alistair Coles
e06c874394 Improve swift-init usage statement
Clarify the behavior of strict and non-strict options.
Define what <server> and <config> specify on the command line.
Drive-by fix for missing param in search_tree docstring.
Change-Id: I89fff88a088bc73001464b1fa8240e14a61a117d
2015年11月25日 18:41:11 +00:00
Jenkins
caebea16d6 Merge "swift-init return codes" 2015年11月25日 16:25:55 +00:00
Tim Burke
0e5cc89da5 Have versioned_writes use reverse listings
This will reduce the overhead required for versioned containers in terms
of memory, back-end requests, and wall time.
Change-Id: I156216a14141db547de3cae1dcd5315ae31eaac2
2015年11月24日 12:41:31 -08:00
Jenkins
dc774390da Merge "Reverse-listings follow-up" 2015年11月24日 20:03:53 +00:00
Jenkins
f48c6f508e Merge "Add container and account reverse listings" 2015年11月24日 17:54:57 +00:00
Alistair Coles
aeccbc2074 Add more functional tests for reverse listings
Also fix typo in the api doc.
Follow-on to change I5eb655360ac95042877da26d18707aebc11c02f6
Change-Id: Ic1ea63c74a0a3b90a505865fba8fcfac584d0825
2015年11月24日 17:13:47 +00:00
Tim Burke
41897d96a7 Reverse-listings follow-up
* With the end_prefix changes in the original commit, we no longer need
 the `or not name.startswith(prefix)` check.
 * Improve test coverage of reverse path listings.
Change-Id: Iaa7d4b83647c3c150be95f88cb3cc9e4f0e33979
2015年11月24日 08:53:51 -08:00
Jenkins
fe1d27bf8a Merge "remove Python 2.6-specific logging workaround" 2015年11月24日 16:49:20 +00:00
Matthew Oliver
7c1e6cd583 Add container and account reverse listings
This change adds the ability to tell the container or account server to
reverse their listings. This is done by sending a reverse=TRUE_VALUE,
Where TRUE_VALUE is one of the values true can be in common/utils:
 TRUE_VALUES = set(('true', '1', 'yes', 'on', 't', 'y'))
For example:
 curl -i -X GET -H "X-Auth-Token: $TOKEN" $STORAGE_URL/c/?reverse=on
I borrowed the swapping of the markers code from Kevin's old change,
thanks Kevin. And Tim Burke added some real nuggets of awesomeness.
DocImpact
Co-Authored-By: Kevin McDonald <kmcdonald@softlayer.com>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Implements: blueprint reverse-object-listing
Change-Id: I5eb655360ac95042877da26d18707aebc11c02f6
2015年11月24日 15:08:45 +00:00
Jenkins
30cb6e9dd0 Merge "Remove _keystone_identity method" 2015年11月24日 13:02:55 +00:00
Jenkins
5474b8a6f6 Merge "Unit tests for account/backend.py" 2015年11月24日 02:25:35 +00:00
Jenkins
09133f5bd9 Merge "remove pbr from requirements.txt. It's not a run-time dependency" 2015年11月24日 00:03:43 +00:00
Ganesh Maharaj Mahalingam
8982233981 Unit tests for account/backend.py
Add test for database create request without account
Partial test for migrate call on database with storage_policy_index
Change-Id: I7cfbd6bc7e2b341f433d88f600b19e54826a0e22
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2015年11月23日 23:30:08 +00:00
Jenkins
b9dae3b063 Merge "Update .mailmap entry" 2015年11月23日 20:19:41 +00:00
Jenkins
c351059577 Merge "Added unit test cases for container/auditor.py" 2015年11月23日 20:17:40 +00:00
Alistair Coles
f80c97a6e9 Update .mailmap entry
Fix/add entries for authors that are known to now have
@hpe.com email addresses.
Change-Id: I62c83b64e2378cb3d6ad33ac9e6ab111b8a8c86f
2015年11月23日 18:01:52 +00:00
Jenkins
a90c7b205d Merge "Ignore Content-Type from client on multipart-manifest=delete" 2015年11月23日 05:06:00 +00:00
Peter Lisák
16de32f168 Log error if a local device not identified in replicator
Example:
* Different port in config and in ring file.
* Running daemon on server not in ring file.
In both cases replication daemon is running but nothing is replicated.
Error log helps to distinguish a local device can't be identified.
Closes-Bug: 1508228
Change-Id: I99351b7d9946f250b7750df91c13d09352a145ce
2015年11月21日 14:04:32 +01:00
Tim Burke
848d7299a2 Ignore Content-Type from client on multipart-manifest=delete
Otherwise, if a client includes something like:
 Content-Type: application/x-www-form-urlencoded
...we won't delete anything, and instead send back:
 Number Deleted: 0
 Number Not Found: 0
 Response Body:
 Response Status: 406 Not Acceptable
 Errors:
...despite the fact that we're managing the iterator, so we know it's
acceptable.
Change-Id: I791c7bda1d9df830d8dacd3783c2393db5a9ac09
2015年11月20日 11:58:44 -08:00
Sivasathurappan Radhakrishnan
c4eeea7820 Added unit test cases for container/auditor.py
Added unit test cases to cover all code path in _one_audit_pass
function in container/auditor.py
Change-Id: I8b89e94f1492e4366af3ac4260587e988ba29408
2015年11月20日 16:07:17 +00:00
Victor Stinner
bdb7bf4032 py3: Add py34 test environment to tox
Add a py34 test environment to tox.ini using a whitelist
of tests which pass on Python 3. Currently, only test_exceptions.py
of test/unit/common/ is run on Python 3
Change-Id: I5c8a9fe7b9635f1acab8f401908975fc6fc58c7a
2015年11月20日 09:00:59 +01:00
Jenkins
70bab151b9 Merge "Add unit tests for direct_client" 2015年11月19日 23:59:32 +00:00