Repository navigation
rgw/admin: radosgw-admin topic dump follows max-entries - #71144
Conversation
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
d3ccd79 to
1534afd
Compare
|
ok to test |
|
@yuvalif Please take a look if you can, fix to a bug you reported. |
|
jenkins test make check arm64 |
|
pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/79880 |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@pritha-srivastava would appriciate your review of 2658734 ? |
|
@akkki007 why was the test added to cls 2pc queue and not to cls queue suite? |
@akkki007 what was the behavior before the fix? |
2658734 to
7267ee1
Compare
|
Moved it, you are right: the fix is in |
It was silently taken for the front of the queue, so the dump started from the beginning of the shard instead of reporting anything.
cls_queue_marker start_marker;
start_marker.from_str(op.start_marker.c_str()); // result ignored
...
if (start_marker.offset == 0) {
start_offset = head.front.offset; // the front, for every unparsable marker
gen = head.front.gen;Checked it against the cls from before the fix, on a queue with 20 entries: With the fix the same call returns So the two halves of a bad marker failed differently: a marker that did not parse quietly restarted the listing from the beginning (wrong result, no error), while a marker that parsed but pointed past the tail hung the cls method in the OSD. |
There is one neighbour worth mentioning, though it is not reachable from outside today: |
The max-entries parameter was only used as the batch size of the calls to the queue, while the command itself kept listing until every shard was exhausted, so from the caller's point of view all the entries were always dumped at once. Return at most max-entries notifications, and a marker to continue from. The marker holds both the shard and the position inside it, so a dump can resume in the middle of a shard. The --marker option already existed but was shadowed by a local variable, so it is now wired to the command. The output is now an object holding the entries under "eventEntries", together with "truncated" and "marker", instead of a bare array. This is a change of the output format, and is noted in the release notes. Fixes: https://tracker.ceph.com/issues/78695 Signed-off-by: Akshay Nazare <[email protected]>
Follow up on the review of the pagination of "radosgw-admin topic dump". The limit on the number of entries returned to the caller is now a const, so that it is clear it does not change while the shards are listed, and the shard part of the marker is no longer the only one checked: the position inside the shard has to be a queue marker as well, otherwise the marker is rejected. Extend the test to cover the pagination across shards, a marker that holds a shard and no position inside it, and the markers that are rejected. Signed-off-by: Akshay Nazare <[email protected]>
queue_list_entries() ignored the result of parsing the start marker, and did not check that the position it holds is one that the queue actually holds. A marker past the tail makes the size of the contiguous data to read underflow, and the loop then keeps reading empty chunks past the end of the queue, which never ends: the cls method spins in the OSD until it is killed. This was not reachable while the only markers passed to the queue were the ones it had returned, but "radosgw-admin topic dump" now takes a marker from the caller, and a marker that was valid can also become stale once the entries it points at have been consumed. Parse the marker, and return EINVAL for a position that is not between the front and the tail of the queue. Signed-off-by: Akshay Nazare <[email protected]>
7267ee1 to
310ffde
Compare
could yopu please open a sepaarte tracker for that? |
|
This PR has been added to wip-anrao16-testing-2026-11-06-0456-main. |
pr testing completed and approved by @ivancich more details on :https://tracker.ceph.com/issues/82839 |
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are: Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
Fixes: https://tracker.ceph.com/issues/78695
Problem
--max-entrieswas only used as the batch size of the calls to the queue. The command itself kept listing until every shard was exhausted, so from the caller's point of view all pending notifications were always dumped in one go, and there was no way to page through a large queue.Fix
Return at most
--max-entriesnotifications and a marker to continue from.<shard index>#<queue marker>), because the persistent queue is sharded and a page can end in the middle of a shard.--markeralready existed as a global option but was shadowed by a local variable in the handler, so it only needed wiring up.eventEntries, together withtruncatedandmarker, instead of a bare array. The shape is the same whether or not the flags are passed. This changes the output format, so it is called out inPendingReleaseNotes.--max-entriesis not given, everything is dumped as before, just in the new shape. When it is given it is clamped to at least 1, matching whatradosgw-admin bi listdoes.Two unrelated things in the rewritten block, worth pointing out since they show up in the diff:
librados::ObjectReadOperation ropwas declared outside both loops and reused.cls_2pc_queue_list_entriesappends to the op, so each iteration was sending a progressively larger operation. It is now scoped to the iteration.cpp_strerror(-ret)while checkingrc, printing a stale error code. They now report-rc.Testing
vstart, one radosgw, a persistent topic with an unreachable endpoint so 23 notifications stayed queued across 11 shards. Paging with
--max-entries 5:The pages reassemble into exactly the same set as an unpaginated dump, with no missing and no repeated events. Both marker cases are exercised:
2#0/25092resumes in the middle of a shard,6#starts at the next one. No page exceeded the limit, and with no flags at all the output hastruncated: falseand an empty marker.Added
test_persistent_topic_dump_pagination, which does the same walk: it checks that no page exceeds--max-entries, that the pages hold every event and none of them twice, and that a dump without the flag reportstruncated: falseand an empty marker. Liketest_ps_s3_x_amz_request_id_on_masterit uses a wrong endpoint to keep the events queued, so it needs no broker.test_bn.pyalso reads the dump in six other places, all updated for the new shape. The new test,test_ps_s3_x_amz_request_id_on_masterandtest_ps_s3_notification_concurrent_put_eventtimepass locally.test_persistent_topic_dumpis akafka_testand was not run locally for lack of a broker.Marker validation, and a hang in the queue
Since the marker now comes from the caller, it is checked before the command runs: the shard has to exist, and the position inside it has to be a queue marker. A marker that parses but points past the tail of the shard used to hang the command, and the OSD with it:
queue_list_entries()computescontiguous_data_size = head.tail.offset - start_offset, which underflows for a start offset past the tail, and the loop then reads empty chunks past the end of the queue forever. The second commit makesqueue_list_entries()check the result of parsing the marker and reject a position that is not between the front and the tail, and addsTestCls2PCQueue.ListInvalidMarkerfor it.ceph_test_cls_2pc_queue(25 tests) andceph_test_cls_queue(17 tests) pass with the change, including the wrap-around and spillover ones.Related
Same area as #70956 (merged) and #71092 (open), but independent of both. This branch is cut from main and the only file they have in common is
doc/radosgw/notifications.rst, in a different section.Checklist