rgw: VersionIdMarker and NextVersionIdMarker should be returned when listing

object versions if necessary.

Fixes: http://tracker.ceph.com/issues/19886

Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
This commit is contained in:
Zhang Shaowen 2017-05-09 16:39:39 +08:00
parent 69de7bc3a2
commit f805c3e089
2 changed files with 5 additions and 2 deletions

View File

@ -1983,7 +1983,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

@ -539,8 +539,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);