rgw: add the support for X-History-Location in swift API#15020
rgw: add the support for X-History-Location in swift API#15020Jing-Scott wants to merge 3 commits intoceph:masterfrom
Conversation
|
Hi, @rzarzynski , can you help to have a look about this feature? |
8c7c940 to
29b7951
Compare
| if (s->info.env->exists("HTTP_X_VERSIONS_LOCATION")) { | ||
| bool ver_exists = s->info.env->exists("HTTP_X_VERSIONS_LOCATION"); | ||
| bool his_exists = s->info.env->exists("HTTP_X_HISTORY_LOCATION"); | ||
| if (ver_exists && his_exists) { |
| ::decode(swift_versioning, bl); | ||
| if (swift_versioning) { | ||
| ::decode(swift_ver_location, bl); | ||
| ::decode(swift_his_location, bl); |
There was a problem hiding this comment.
I think this should be performed only for the version 18 and above.
There was a problem hiding this comment.
@Jing-Scott swift_ver_location shouldn't require version 18, right?
Signed-off-by: Jing Wenjun <[email protected]>
Signed-off-by: Jing Wenjun <[email protected]>
The feature is described at https://github.com/openstack/swift/blob/2.12.0/swift/common/middleware/versioned_writes.py#L23-L30 Signed-off-by: Jing Wenjun <[email protected]>
29b7951 to
bd226b6
Compare
|
jekins test this please |
|
@rzarzynski i have rebased and changed to version 18. |
| ::encode(swift_versioning, bl); | ||
| if (swift_versioning) { | ||
| ::encode(swift_ver_location, bl); | ||
| ::encode(swift_his_location, bl); |
There was a problem hiding this comment.
To preserve compatibility with older struct versions, we should encode new fields at the end, not in the middle. This is required during e.g. cluster upgrades when many instances of RadosGW, possibly from two different releases, may coexist in a single cluster.
| ::decode(mdsearch_config, bl); | ||
| if (swift_versioning) { | ||
| ::decode(swift_ver_location, bl); | ||
| ::decode(swift_his_location, bl); |
There was a problem hiding this comment.
This field comes with version 20th, not 18th.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
mattbenjamin
left a comment
There was a problem hiding this comment.
@Jing-Scott I would like to encorporate these improvements, but I think there are problems remaining, e.g., the struct versioning decoding issues @rzarzynski pointed out; if you are willing to update, that would be great!
| const string& src_name = src_obj.get_oid(); | ||
| char buf[src_name.size() + 32]; | ||
| struct timespec ts = ceph::real_clock::to_timespec(ceph::real_clock::now()); | ||
| snprintf(buf, sizeof(buf), "%03x%s/%lld.%06ld", (int)src_name.size(), |
There was a problem hiding this comment.
could we use boost::format() boost::str() idioms here?
| ::encode(swift_versioning, bl); | ||
| if (swift_versioning) { | ||
| ::encode(swift_ver_location, bl); | ||
| ::encode(swift_his_location, bl); |
| ::decode(swift_versioning, bl); | ||
| if (swift_versioning) { | ||
| ::decode(swift_ver_location, bl); | ||
| ::decode(swift_his_location, bl); |
There was a problem hiding this comment.
@Jing-Scott swift_ver_location shouldn't require version 18, right?
| swift_ver_location.clear(); | ||
| if (struct_v >= 16) { | ||
| swift_his_location.clear(); | ||
| if (struct_v >= 18) { |
There was a problem hiding this comment.
Something weird happened here. IIUC swift_versioning and swift_ver_location can be present since struct_v 16th but now we expect it only since 18th. I believe we shouldn't touch this but instead introduce:
swift_his_location.clear();
if (struct_v >= 20 && swift_versioning) {
::decode(swift_his_location, bl);
}just before DECODE_FINISH(bl).
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
|
reopen for re-review |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
The feature is described at https://github.com/openstack/swift/blob/2.12.0/swift/common/middleware/versioned_writes.py#L23-L30
Signed-off-by: Jing Wenjun [email protected]