On Thu, Jul 31, 2014 at 8:34 PM, star fan <jfanix@xxxxxxxxx> wrote: > Hi Yehuda, > > I think there are logic error about max_entries > betweenRGWOp_BILog_List::execute() and store->list_bi_log_entries. > > Look at the codes: > in RGWOp_BILog_List::execute() > do { > > list<rgw_bi_log_entry> entries; > int ret = store->list_bi_log_entries(bucket_info.bucket, > marker, max_entries - count, > entries, &truncated); > if (ret < 0) { > dout(5) << "ERROR: list_bi_log_entries()" << dendl; > return; > } > > count += entries.size(); > > send_response(entries, marker); > } while (truncated && count < max_entries); > > and RGWRados::list_bi_log_entries > int ret = cls_rgw_bi_log_list(index_ctx, oid, marker, max - > result.size(), entries, truncated); > > I think there is a conflict between "max_entries - count" and "max - > result.size()". I think this bug is hard to test since I don't know > how the bi log creates. > Right. Looking at the code, there are a couple of issues. First, as you pointed out RGWOp_BILog_List::execute() assumes that entries are cleared within the call to store->list_bi_log_entries(), but the latter assumes the opposite (that the result is appended). The second issue that I see is that we shouldn't call to list::size() as it's O(N). Thanks, Yehuda -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html