#include "rgw_client_io.h"
#include "rgw_sync.h"
#include "rgw_data_sync.h"
+#include "rgw_common.h"
#include "common/errno.h"
#include "include/assert.h"
http_ret = -EINVAL;
return;
}
+ if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+ max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+ }
}
if (period.empty()) {
meta_log.init_list_entries(shard_id, ut_st, ut_et, marker, &handle);
- do {
- http_ret = meta_log.list_entries(handle, max_entries, entries,
- &last_marker, &truncated);
- if (http_ret < 0)
- break;
-
- if (!max_entries_str.empty())
- max_entries -= entries.size();
- } while (truncated && (max_entries > 0));
+ http_ret = meta_log.list_entries(handle, max_entries, entries,
+ &last_marker, &truncated);
meta_log.complete_list_entries(handle);
}
}
}
map<RGWObjCategory, RGWStorageStats> stats;
- int ret = store->get_bucket_stats(bucket_info, shard_id, &bucket_ver, &master_ver, stats, &max_marker);
+ int ret = store->get_bucket_stats(bucket_info, shard_id, &bucket_ver, &master_ver, stats, &max_marker, &syncstopped);
if (ret < 0 && ret != -ENOENT) {
http_ret = ret;
return;
encode_json("bucket_ver", bucket_ver, s->formatter);
encode_json("master_ver", master_ver, s->formatter);
encode_json("max_marker", max_marker, s->formatter);
+ encode_json("syncstopped", syncstopped, s->formatter);
s->formatter->close_section();
flusher.flush();
http_ret = -EINVAL;
return;
}
- }
-
- do {
- // Note that last_marker is updated to be the marker of the last
- // entry listed
- http_ret = store->data_log->list_entries(shard_id, ut_st, ut_et,
- max_entries, entries, marker,
- &last_marker, &truncated);
- if (http_ret < 0)
- break;
-
- if (!max_entries_str.empty())
- max_entries -= entries.size();
- } while (truncated && (max_entries > 0));
+ if (max_entries > LOG_CLASS_LIST_MAX_ENTRIES) {
+ max_entries = LOG_CLASS_LIST_MAX_ENTRIES;
+ }
+ }
+
+ // Note that last_marker is updated to be the marker of the last
+ // entry listed
+ http_ret = store->data_log->list_entries(shard_id, ut_st, ut_et,
+ max_entries, entries, marker,
+ &last_marker, &truncated);
}
void RGWOp_DATALog_List::send_response() {