HTTP_X_NEWEST requests require objects to have a timestamp header
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In proxy/server.py GETorHEAD_base, the code block to find the newest object will never select a source if the objects don't have x-put-timestamp or x-timestamp headers. I ran into this issue when testing the upgrade from Cactus (using swauth) to 1.4.2 (using swauth 1.0.3-dev). The swauth user objects don't have timestamps set and the authentication process fails when GETorHEAD_base returns a 404.
The issue is that the 'pts > ts' condition never sets source if all of the object timestamps are 0. Always setting source to possible_source when source is undefined would fix this issue, but it would change the behavior of HTTP_X_NEWEST requests. I'm not sure how strict HTTP_X_NEWEST was intended to be.
(line 647 in current trunk)
if newest:
ts = 0
if source:
ts = float(source.
pts = float(possible_
if pts > ts:
source = possible_source
continue
Related branches
- John Dickinson: Approve
- gholt (community): Approve
-
Diff: 170 lines (+25/-15)2 files modifiedswift/proxy/server.py (+6/-4)
test/unit/proxy/test_server.py (+19/-11)
Changed in swift: | |
milestone: | none → 1.4.3 |
status: | New → Fix Committed |
status: | Fix Committed → Fix Released |
The linked branch will set 'source = possible_source' if source does not exist. Regardless of whether or not a timestamp is present.