-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw: add the support for X-History-Location in swift API #15020
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1180,6 +1180,7 @@ struct RGWBucketInfo | |
|
||
bool swift_versioning; | ||
string swift_ver_location; | ||
string swift_his_location; | ||
|
||
map<string, uint32_t> mdsearch_config; | ||
|
||
|
@@ -1188,7 +1189,7 @@ struct RGWBucketInfo | |
string new_bucket_instance_id; | ||
|
||
void encode(bufferlist& bl) const { | ||
ENCODE_START(19, 4, bl); | ||
ENCODE_START(20, 4, bl); | ||
::encode(bucket, bl); | ||
::encode(owner.id, bl); | ||
::encode(flags, bl); | ||
|
@@ -1210,6 +1211,7 @@ struct RGWBucketInfo | |
::encode(swift_versioning, bl); | ||
if (swift_versioning) { | ||
::encode(swift_ver_location, bl); | ||
::encode(swift_his_location, bl); | ||
} | ||
::encode(creation_time, bl); | ||
::encode(mdsearch_config, bl); | ||
|
@@ -1218,7 +1220,7 @@ struct RGWBucketInfo | |
ENCODE_FINISH(bl); | ||
} | ||
void decode(bufferlist::iterator& bl) { | ||
DECODE_START_LEGACY_COMPAT_LEN_32(19, 4, 4, bl); | ||
DECODE_START_LEGACY_COMPAT_LEN_32(20, 4, 4, bl); | ||
::decode(bucket, bl); | ||
if (struct_v >= 2) { | ||
string s; | ||
|
@@ -1266,18 +1268,18 @@ struct RGWBucketInfo | |
} | ||
swift_versioning = false; | ||
swift_ver_location.clear(); | ||
if (struct_v >= 16) { | ||
swift_his_location.clear(); | ||
if (struct_v >= 18) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something weird happened here. IIUC swift_his_location.clear();
if (struct_v >= 20 && swift_versioning) {
::decode(swift_his_location, bl);
} just before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, @rzarzynski ! |
||
::decode(swift_versioning, bl); | ||
::decode(mdsearch_config, bl); | ||
if (swift_versioning) { | ||
::decode(swift_ver_location, bl); | ||
::decode(swift_his_location, bl); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field comes with version 20th, not 18th. |
||
} | ||
} | ||
if (struct_v >= 17) { | ||
::decode(creation_time, bl); | ||
} | ||
if (struct_v >= 18) { | ||
::decode(mdsearch_config, bl); | ||
} | ||
if (struct_v >= 19) { | ||
::decode(reshard_status, bl); | ||
::decode(new_bucket_instance_id, bl); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rzarzynski seems to be fixed now?