Merge pull request #15014 from zhangsw/fix-rgw-versionIdMarker-bug

rgw: VersionIdMarker and NextVersionIdMarker should be returned when listing object versions

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2017-06-20 16:07:46 -04:00 committed by GitHub
commit c3b5a4b16b
2 changed files with 5 additions and 2 deletions

View File

@ -2117,7 +2117,7 @@ void RGWListBucket::execute()
list_op.params.list_versions = list_versions;
op_ret = list_op.list_objects(max, &objs, &common_prefixes, &is_truncated);
if (op_ret >= 0 && !delimiter.empty()) {
if (op_ret >= 0) {
next_marker = list_op.get_next_marker();
}
}

View File

@ -548,8 +548,11 @@ void RGWListBucket_ObjStore_S3::send_versioned_response()
s->formatter->dump_string("Name", s->bucket_name);
s->formatter->dump_string("Prefix", prefix);
s->formatter->dump_string("KeyMarker", marker.name);
if (is_truncated && !next_marker.empty())
s->formatter->dump_string("VersionIdMarker", marker.instance);
if (is_truncated && !next_marker.empty()) {
s->formatter->dump_string("NextKeyMarker", next_marker.name);
s->formatter->dump_string("NextVersionIdMarker", next_marker.instance);
}
s->formatter->dump_int("MaxKeys", max);
if (!delimiter.empty())
s->formatter->dump_string("Delimiter", delimiter);