Repository navigation
rgw/notify: report topic queue ownership in topic stats - #71092
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 |
|
Hii @yuvalif Check this PR once and let me know if any changes |
|
Gentle ping on this one — it's been sitting since 17 Aug with the It's small (+58/-1 across two rgw_notify files and the notifications doc) and implements what was agreed on the tracker for #78693: reporting per-shard queue lock ownership and expiry in @adamemerson you enabled CI on my other two RGW PRs — would you mind doing the same here? And @yuvalif, since you raised the original issue, I'd value your read on whether the reported shape matches what you had in mind. No rush if it's simply low priority — I'd just like to know whether it's worth keeping current, or whether you'd rather it be closed. |
|
The owner of a persistent topic queue was not exposed anywhere, so there was no way to tell which radosgw is processing a topic, or until when it holds it. The information is already in the queue's lock, so report it from "radosgw-admin topic stats". Each queue shard is reported separately, since in a cluster with several gateways the shards of one topic may be owned by different ones. A shard which is not owned by any gateway is reported without an owner. The daemon name is now stored in the lock description, so that the owner can be identified. A lock held by a gateway that predates this carries an empty description, which can be seen while an upgrade is ongoing, so the ownership is kept as an optional whose absence means the shard is not owned at all. Fixes: https://tracker.ceph.com/issues/78693 Signed-off-by: Akshay Nazare <[email protected]>
Add a test that a persistent topic reports each of its queue shards, that the ownership fields of a shard appear together or not at all, and that a shard being processed names the gateway holding its lock. The lock is held for as long as the gateway processes the queue and is renewed meanwhile, so the ownership is still there once the queue has drained and the test does not have to race it. Signed-off-by: Akshay Nazare <[email protected]>
393c971 to
e83ed4b
Compare
|
Both done, and the two code comments turned up real problems — thanks. Sample output. From a vstart cluster with one gateway, after creating a persistent topic and writing one object. Truncated to the first three shards, since the default {
"Topic Stats": {
"Reservations": 0,
"Size": 529,
"Entries": 1,
"Shards": [
{
"Name": ":sample-topic",
"Owner": "client.rgw.8000",
"Owner Address": "172.20.10.5:0/3549198245",
"Ownership Expiration": "2026-09-01T17:29:54.108770+0530"
},
{
"Name": ":sample-topic.1",
"Owner": "client.rgw.8000",
"Owner Address": "172.20.10.5:0/3549198245",
"Ownership Expiration": "2026-09-01T17:29:54.123207+0530"
},
{
"Name": ":sample-topic.2",
"Owner": "client.rgw.8000",
"Owner Address": "172.20.10.5:0/3549198245",
"Ownership Expiration": "2026-09-01T17:29:54.140132+0530"
}
]
}
}And the same topic after stopping the gateway and letting the locks expire, which is how an unowned shard reads: "Shards": [
{
"Name": ":sample-topic"
},
{
"Name": ":sample-topic.1"
},
{
"Name": ":sample-topic.2"
}
]Test. Added The |
|
ok to test |
|
@akkki007 seems to be an issue with the owner address: what does : "0/3549198245" mean? |
|
@yuvalif The port is 0 because the lock is taken over a client connection: the gateway has no listening port for it, and cls_lock records the locker's address as seen from the request origin. The nonce is the random per-process value Ceph uses to tell instances apart, so it is what distinguishes two gateways on the same host, or the same gateway before and after a restart. It comes from |
thanks for the info. please keep it. it would help top identify an rgw restart where the "owner" looks the same, but the address is different. |
|
jenkins test windows |
|
This PR has been added to main integration testing by anuchaithra started 2026-09-28-05:23. |
pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/80952 |
Fixes: https://tracker.ceph.com/issues/78693
Problem
There was no way to tell which radosgw is processing a persistent topic, or until when it holds it.
radosgw-admin topic statsreported only reservations, size and entries.Fix
The information is already in the queue's
cls_lock, so report it fromtopic stats. Per the tracker discussion:rgw_notifypreviously passed an empty description. Neither of the fieldscls_lockalready stored identifies a gateway usefully: the entity name isclient.<global_id>assigned by the monitor at connect time, and the address is the librados client address, whose port is an ephemeral messenger port rather than the S3 frontend. Locks taken before this change carry an empty description until their next renewal.Testing
vstart, 2 radosgws, one persistent topic (11 shards):
All 11 shards reported
client.rgw.8000. Killing that gateway withkill -9at 12:07:40 moved every shard toclient.rgw.8001by 12:08:53, inside the 90s ownership timeout, so the reported owner follows the actual one.No automated test: verifying this needs two gateways and a failover, which the bucket notification tests cannot currently set up.
Checklist