0bc52a6036d7d18c484b013319c7b11cfb9958ca
Commit Graph

7374 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Zuul
0bc52a6036 Merge "swift-recon-cron: do not get confused by files in /srv/node" 2018年04月13日 04:14:31 +00:00
Tim Burke
f1bbb5f980 Clean up SegmentError messages
Since we already deducted the full length of the chunk from bytes_left
before raising the too-many-bytes error, the value in the error message
was always negative, like
 Too many bytes for /v1/AUTH_test/c%3Fwith-question-mark/dlo;
 truncating in /v1/AUTH_test/c with -27244 bytes left
In the not-enough-bytes case, we may as well mention how many more bytes
we were expecting.
Change-Id: I155ed1837d40b4aaf929452b830f03c1daab0af7
2018年04月12日 20:59:24 +00:00
Zuul
0a6f0d615c Merge "Improve check for O_TMPFILE support in unit tests" 2018年04月12日 09:32:01 +00:00
Zuul
79001f39ca Merge "Add ability to run specific tests in py35 tox environment." 2018年04月12日 00:23:16 +00:00
Zuul
c9ddee7aac Merge "swift-(account|container)-info: tolerate LockTimeouts" 2018年04月11日 07:24:53 +00:00
Zuul
3997b23e79 Merge "swob.Match: add __repr__" 2018年04月11日 03:21:22 +00:00
Zuul
e4660a3e31 Merge "Add manpage for swift-object-relinker" 2018年04月11日 01:35:07 +00:00
Zuul
f8175ea345 Merge "Add full working example of sharing a container with another user" 2018年04月11日 00:15:30 +00:00
Tim Burke
5b68eb5396 swift-(account|container)-info: tolerate LockTimeouts
I'm not really clear on why a sqlite3.OperationalError should cause us to
retry with stale_reads_ok=True, but swift.common.exceptions.LockTimeout
*definitely* should.
Change-Id: I707dec1d11b8db80bc8fbee30662b319bf10d6a5
2018年04月10日 17:09:07 -07:00
Samuel Merritt
c42f15f94d Add ability to run specific tests in py35 tox environment.
This lets you run something like
 $ tox -e py35 -- -s test.unit.common.test_swob
and just run the swob tests. This is handy if you've got one or two
test failures to debug or if you're trying to get another test file
passing under Python 3.
Also removed the old py34 environment. Nothing uses it.
Change-Id: I244b8903ef0a445abd028004bf02d6c581a8afe2
2018年04月10日 17:00:54 -07:00
Samuel Merritt
b0b3ed0309 Improve check for O_TMPFILE support in unit tests
On Python < 3.4, there is no os.O_TMPFILE, so the check for O_TMPFILE
support was always reporting no-support. We now use utils.O_TMPFILE,
which is always defined.
Also, when opening an anonymous tempfile, you must open the directory
(not a file in the directory) with three flags or-ed together:
O_DIRECTORY, O_WRONLY, and O_TMPFILE. Calling open() with a subset of
those flags will receive either EISDIR or EINVAL. The check was trying
to open a file in the temp dir, so was always reporting no-support for
O_TMPFILE. We now correctly open the tempdir.
Change-Id: Iaf48ad9aecea73df4e794818dd15070360bff19f
2018年04月10日 16:33:09 -07:00
Tim Burke
77bfe7affa swob.Match: add __repr__
<swift.common.swob.Match object at 0x7fe589571d50> isn't quite as
obvious.
Change-Id: I7197e7732a4b56084b45ce6a113bc39ce8c7bd54
2018年04月10日 14:21:51 -07:00
Zuul
bbf5e5c7f3 Merge "swob.Match: Optional whitespace is optional" 2018年04月10日 08:13:39 +00:00
Zuul
7150341e3b Merge "Follow the new PTI for document build" 2018年04月10日 07:32:51 +00:00
Zuul
509d4b8355 Merge "Support unicode characters in tempauth user names." 2018年04月06日 09:38:55 +00:00
Zuul
2c405fd804 Merge "Respect X-Backend-Etag-Is-At headers from left of SLO" 2018年04月06日 07:55:46 +00:00
Zuul
329b413494 Merge "Don't log tracebacks on ECONNRESET, ENETUNREACH, BadStatusLine" 2018年04月05日 21:03:55 +00:00
Timur Alperovich
8944e9d8bc Support unicode characters in tempauth user names.
Unicode characters in tempauth user names currently prevent these users
from authenticating. This manifests in two places:
1. the call to get_groups() fails to return a set that matches the user
 preventing authentication
2. a new token is generated every time for such users, as the check
 against existing memcache entries always fails to match
The patch fixes the existing behavior with respect to unicode users. As
part of it, the FakeMemcache class had to change to decode the strings
passed to it to mimic the actual memcache client behavior.
Darrell Bishop developed the patch and Timur Alperovich added the tests
for it.
Change-Id: I4ecfae2bca6ffa08ad15e584579ebce707f4628d
2018年04月05日 10:17:23 -07:00
Tim Burke
5d20411a3f Don't log tracebacks on ECONNRESET, ENETUNREACH, BadStatusLine
Seen during a retart-storm:
Traceback (most recent call last):
 File ".../swift/common/db_replicator.py", line 134, in replicate
 {'Content-Type': 'application/json'})
 File ".../httplib.py", line 1057, in request
 self._send_request(method, url, body, headers)
 File ".../httplib.py", line 1097, in _send_request
 self.endheaders(body)
 File ".../httplib.py", line 1053, in endheaders
 self._send_output(message_body)
 File ".../httplib.py", line 897, in _send_output
 self.send(msg)
 File ".../httplib.py", line 859, in send
 self.connect()
 File ".../swift/common/bufferedhttp.py", line 108, in connect
 return HTTPConnection.connect(self)
 File ".../httplib.py", line 836, in connect
 self.timeout, self.source_address)
 File ".../eventlet/green/socket.py", line 72, in create_connection
 raise err
error: [Errno 104] ECONNRESET
Traceback (most recent call last):
 File ".../swift/obj/replicator.py", line 282, in update
 '', headers=self.headers).getresponse()
 File ".../swift/common/bufferedhttp.py", line 157, in http_connect
 ipaddr, port, method, path, headers, query_string, ssl)
 File ".../swift/common/bufferedhttp.py", line 189, in http_connect_raw
 conn.endheaders()
 File ".../httplib.py", line 1053, in endheaders
 self._send_output(message_body)
 File ".../httplib.py", line 897, in _send_output
 self.send(msg)
 File ".../httplib.py", line 859, in send
 self.connect()
 File ".../swift/common/bufferedhttp.py", line 108, in connect
 return HTTPConnection.connect(self)
 File ".../httplib.py", line 836, in connect
 self.timeout, self.source_address)
 File ".../eventlet/green/socket.py", line 72, in create_connection
 raise err
error: [Errno 101] ENETUNREACH
Traceback (most recent call last):
 File ".../swift/obj/replicator.py", line 282, in update
 '', headers=self.headers).getresponse()
 File ".../swift/common/bufferedhttp.py", line 123, in getresponse
 response = HTTPConnection.getresponse(self)
 File ".../httplib.py", line 1136, in getresponse
 response.begin()
 File ".../httplib.py", line 453, in begin
 version, status, reason = self._read_status()
 File ".../httplib.py", line 417, in _read_status
 raise BadStatusLine(line)
BadStatusLine: ''
(Different transactions, of course.)
Change-Id: I07192b8d2ece2d2ee04fe0d877ead6fbfc321d86
2018年04月03日 21:42:18 -07:00
Zuul
10eb94b3d8 Merge "Remove object replicator's lockup detector/mitigator." 2018年04月03日 01:48:13 +00:00
Tim Burke
42adbe561f Respect X-Backend-Etag-Is-At headers from left of SLO
If a middleware left of SLO wants to override the ETag for a large
object, it will need to send a X-Backend-Etag-Is-At on GETs if it wants
to be at all performant. This would work fine coming out of the object
controller (which would look at the headers in the response, figure out
what's the real conditional etag, and pass it to swob.Response), and
even encryption (which would do the same), but at SLO, we'd just replace
the ETag, flag it as a conditional response, and let swob assume the
*SLO* ETag is the conditional one.
Now, SLO will jump through the same resolve_backend_etag_is_at hoops that
other parts of the proxy have to deal with. This allows If-Match and
If-None-Match to work correctly if/when swift3 stores an S3-compatible
multipart-upload ETag.
Change-Id: Ibbf59d38d7bcc9c485b1d5305548144025d77441
2018年03月26日 23:50:43 +00:00
Tim Burke
baa4fa5d65 swob.Match: Optional whitespace is optional
https://tools.ietf.org/html/rfc7232#section-3 defines the form for
If-Match and If-None-Match as
 If-Match = "*" / 1#entity-tag
 If-None-Match = "*" / 1#entity-tag
https://tools.ietf.org/html/rfc7230#section-7 in turn defines the
1#<type> syntax as
 1#element => element *( OWS "," OWS element )
where OWS is *optional* whitespace. Our swob.Match object should respect
that optionality.
Change-Id: I6ee1c6674e0e9c156149319022fd289504bd3722
2018年03月26日 21:58:20 +00:00
wangqi
a027f2c105 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html
For more details information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html
Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com>
Change-Id: I26dc41c7df57bf79db531c6e67e148e01c17e992
2018年03月26日 12:53:37 +00:00
wanghui
9b4c978f99 Use http code constant instead of int
Change-Id: I1dce94ac6192746a7b90646fe4b4460a651bced1
2018年03月26日 15:24:22 +08:00
Zuul
744d6b6ab3 Merge "Use http code constant instead of int" 2018年03月26日 04:28:05 +00:00
Zuul
70d1ea1893 Merge "Unify expirer unit test task queue" 2018年03月26日 02:29:00 +00:00
melissaml
91e5cba034 Use http code constant instead of int
To keep the consistency, using HTTP_NO_CONTENT instead
of 204
Change-Id: I3d4c0ab6851ce08d1ead0f3b275cb6b41fdb65ac
2018年03月26日 08:50:30 +08:00
Samuel Merritt
ecf8ae50e1 Remove object replicator's lockup detector/mitigator.
Sometimes, an rsync process just won't die. You can send SIGKILL, but
it isn't very effective. This is sometimes seen due to attempted I/O
on a failing disk; with some disks, an rsync process won't die until
Linux finishes the current I/O operation (whether success or failure),
but the disk can't succeed and will retry forever instead of
failing. The net effect is an unkillable rsync process.
The replicator was dealing with this by sending SIGKILL to any rsync
that ran too long, then calling waitpid() in a loop[1] until the rsync
died so it could reap the child process. This worked pretty well
unless it met an unkillable rsync; in that case, one greenthread would
end up blocked for a very long time. Since the replicator's main loop
works by (a) gathering all replication jobs, (b) performing them in
parallel with some limited concurrency, then (c) waiting for all jobs
to complete, an unkillable rsync would block the entire replicator.
There was an attempt to address this by adding a lockup detector: if
the replicator failed to complete any replication cycle in N seconds
[2], all greenthreads except the main one would be terminated and the
replication cycle restarted. It works okay, but only handles total
failure. If you have 20 greenthreads working and 19 of them are
blocked on unkillable rsyncs, then as long as the 20th greenthread
manages to replicate at least one partition every N seconds, the
replicator will just keep limping along.
This commit removes the lockup detector. Instead, when a replicator
greenthread happens upon an rsync that doesn't die promptly after
receiving SIGKILL, the process handle is sent to a background
greenthread; that background greenthread simply waits for those rsync
processes to finally die and reaps them. This lets the replicator make
better progress in the presence of unkillable rsyncs.
[1] It's a call to subprocess.Popen.wait(); the looping and sleeping
happens in eventlet.
[2] The default is 1800 seconds = 30 minutes, but the value is
configurable.
Change-Id: If6dc7b003e18ab4e8a5ed687c965025ebd417dfa
2018年03月22日 17:18:23 -07:00
melissaml
3bc267d10c fix a typo in documentation
Change-Id: I0492ae1d50493585ead919904d6d9502b7738266
2018年03月23日 07:29:02 +08:00
Zuul
9aca9ad780 Merge "Change object_audit_location_generator() to yield for a single policy." 2018年03月22日 06:18:19 +00:00
Alexandre Lécuyer
8d7e245eb5 Change object_audit_location_generator() to yield for a single policy.
auditor.py currently relies on POLICY[0] object_audit_location_generator()
to yield an AuditLocation for all policies on the object-server.
The changes in this patch are :
 - object_audit_location_generator() yields AuditLocation only for the
 requested policy
 - audit_all_objects() calls object_audit_location_generator() for each
 policy
Closes-Bug: 1534212
Change-Id: Ida92ba0a5e1e486a4f7132c6539460b38c34ec87
2018年03月22日 03:02:35 +00:00
Zuul
7bacb38c76 Merge "Add round_robin_iter function to common/utils" 2018年03月20日 22:47:14 +00:00
Zuul
0b649d5387 Merge "Refactor tempurl functional test's try-finally" 2018年03月20日 19:47:43 +00:00
Alexandre Lécuyer
9f4910f6b9 Add round_robin_iter function to common/utils
Move the existing code in db_replicator.py to utils.py
Change-Id: I04e3f30a82c89fb7e714c5eb7225374b9a5c76f9
2018年03月20日 15:18:58 +01:00
Kazuhiro MIYAHARA
7e77bf34f2 Refactor tempurl functional test's try-finally
This is a following patch of [1]. In [1] comment, tim suggested
implementation for same behavior with less code.
This change implemented the suggestion. See [1] for more details.
[1]: https://review.openstack.org/#/c/547306/
Change-Id: Ifd8a0534fbdf41837977028c0c6ef99f1f6ac0f0
2018年03月20日 09:02:58 +00:00
Zuul
08938eeb33 Merge "Encapsulate some general utility in utils" 2018年03月20日 06:45:35 +00:00
Zuul
900bd2f0ab Merge "Use state when you have it" 2018年03月20日 00:05:16 +00:00
Zuul
b20893f540 Merge "Support -d <devs> and -p <partitions> in DB replicators." 2018年03月20日 00:04:01 +00:00
Clay Gerrard
2c4c23defc Encapsulate some general utility in utils
... but either way works.
Change-Id: I56b7689270e528a1d2099ff96030ce660e588c94
Related-Change-Id: Ic108f5c38f700ac4c7bcf8315bf4c55306951361
2018年03月16日 18:45:16 -07:00
Clay Gerrard
bb3553d084 Use state when you have it
... but either way works.
Change-Id: Ib66ee035229d0718b68450587550176c91ce9ca6
Related-Change-Id: Ic108f5c38f700ac4c7bcf8315bf4c55306951361
2018年03月16日 18:17:59 -07:00
Zuul
f2e8565bb6 Merge "Ensure reverting test env if the env is temporarily changed" 2018年03月15日 02:19:40 +00:00
Zuul
5fa1c9e8bb Merge "py3: port cli form_signature and unit tests" 2018年03月15日 02:19:37 +00:00
Zuul
787c114ec4 Merge "Fix tests using O_TMPFILE" 2018年03月15日 00:40:55 +00:00
Zuul
44070c0eec Merge "Add handoffs-only mode to DB replicators." 2018年03月14日 20:36:31 +00:00
Samuel Merritt
de38b727b4 Don't double-filter replication jobs
ObjectReplicator.collect_jobs() takes and correctly applies the
various overrides, so there's no need to check the returned jobs
against the overrides.
Change-Id: I2a59b26410d1732a5f2c8f1f32e397d77550860e
2018年03月13日 11:44:10 -07:00
Thomas Goirand
22b9a4a943 Fix tests using O_TMPFILE
Unit tests using O_TMPFILE only rely on the kernel version to check
for the feature. This is wrong, as some filesystem, like tmpfs, doesn't
support O_TMPFILE.
So, instead of checking kernel version, this patch actually attempts to
open a file using O_TMPFILE and see if that's supported. If not, then
the test is skipped.
Change-Id: I5d652f1634b1ef940838573cfdd799ea17b8b572
2018年03月13日 12:06:07 +00:00
Matthew Oliver
e84ed57a72 py3: port cli form_signature and unit tests
This patch ports the form_signature cli `swift-form-signature`
and it's corrisponding tests to py3.
In essence in Py3 the HMAC function expects binary strings.
Change-Id: I5dded4ceb80f0cc595403775e8f9c17873e1e37b
2018年03月13日 06:19:44 +00:00
Zuul
0a4d1b7e22 Merge "Capture probe test logs" 2018年03月13日 03:39:03 +00:00
Zuul
2c7e12289f Merge "Optionally drop common prefixes in swift-*-info output" 2018年03月13日 03:39:02 +00:00
Zuul
4fd7b0354c Merge "Apply remote metadata in _handle_sync_response" 2018年03月12日 23:42:57 +00:00