Project

General

Profile

Bug #15771

API: mirror_image_status_list does not work correctly which non-empty `start` argument

Added by Mykola Golub over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
05/07/2016
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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.


Related issues

Copied to rbd - Backport #15814: jewel: API: mirror_image_status_list does not work correctly which non-empty `start` argument Resolved

Associated revisions

Revision e6c709b3 (diff)
Added by Mykola Golub over 2 years ago

rbd-mirror: fixup to get/list mirror image status API

- embed name and rbd_mirror_image_info_t into rbd_mirror_image_status_t;
- index image status list by image id to make 'start' work correctly;
- provide rbd_mirror_image_status_list_cleanup function.

Fixes: #15771
Signed-off-by: Mykola Golub <>

Revision 2d906e60 (diff)
Added by Mykola Golub over 2 years ago

rbd-mirror: fixup to get/list mirror image status API

- embed name and rbd_mirror_image_info_t into rbd_mirror_image_status_t;
- index image status list by image id to make 'start' work correctly;
- provide rbd_mirror_image_status_list_cleanup function.

Fixes: #15771
Signed-off-by: Mykola Golub <>
(cherry picked from commit e6c709b3a8be489a900178b8b0d962705d5687e9)

History

#1 Updated by Mykola Golub over 2 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?

#2 Updated by Jason Dillaman over 2 years ago

  • Backport set to jewel

#3 Updated by Mykola Golub over 2 years ago

  • Status changed from In Progress to Need Review

#4 Updated by Jason Dillaman over 2 years ago

  • Status changed from Need Review to Pending Backport

#5 Updated by Jason Dillaman over 2 years ago

  • Copied to Backport #15814: jewel: API: mirror_image_status_list does not work correctly which non-empty `start` argument added

#6 Updated by Jason Dillaman over 2 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF