Bug #15771
closedAPI: mirror_image_status_list does not work correctly which non-empty `start` argument
0%
Description
rbd_mirror_image_status_list function has `start` (`last_read`) argument used for reading large lists in chunks. It is not work as expected, because user sets it the last read image name, while internally image ID list is used. The consequence e.g. is incorrect behavior of `rbd mirror pool status` for pools with more than 1024 mirroring images.
Updated by Mykola Golub almost 8 years ago
- Status changed from New to In Progress
I don't see how to fix this without changing API. Even if `start` arg, passed by the user as image name, is converted internally to the image id, this image is most probably wont be the last in the previously obtained id list.
I see two possible ways to fix this:
1) change `const std::string &start` to `std::string &start` so it is set to the last read by the function internally (the user will not need to set it manually, just to pass the latest return to the next call).
2) change the function to always return status for all images in the pool (remove max_read limit). In this case there is no a way to control resources for large pools. Also for C API we will need to do all allocation inside the function (right know the arrays are pre-allocated by the caller).
I prefer (1), still I will not have problems if it is (2). What do others think?
Updated by Mykola Golub almost 8 years ago
- Status changed from In Progress to Fix Under Review
Updated by Jason Dillaman almost 8 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Jason Dillaman almost 8 years ago
- Copied to Backport #15814: jewel: API: mirror_image_status_list does not work correctly which non-empty `start` argument added
Updated by Jason Dillaman almost 8 years ago
- Status changed from Pending Backport to Resolved