Enhancement #78693
closednotifications: add ownership info to topic stats command
0%
Description
add the identity of the owner of a topic to the "radosgw-admin topic stats" command
YL Updated by Yuval Lifshitz 4 months ago
- Tags changed from notifications to notifications, low-hanging-fruit
YL Updated by Yuval Lifshitz 4 months ago
this could be taken from the topic's lock. the next renewal time should also be reported
YL Updated by Yuval Lifshitz 4 months ago
- Assignee set to Akshay Nazare
AN Updated by Akshay Nazare 4 months ago ยท Edited
Hii @Yuval Lifshitz makes sense, the lock has everything needed. get_lock_info() on the queue's _lock object returns the locker entity name, the cookie and the address, plus the expiration.
for the next renewal time: the lock only stores the expiration. since the owner writes expiration = now + 3*period and wakes up again at now + period, next renewal = expiration - 2*rgw_topic_ownership_update_period. the caveat is that radosgw-admin would use its own value of that option, so the number would be wrong if the owning gateway runs a different one. is that acceptable, or would you rather report only the expiration?
two questions on the output:
- a persistent topic has 11 shards by default, each with its own lock. normally one gateway owns all of them, but that is not guaranteed. report the owner per shard, or a single owner with a note when they differ?
- for the identity i was thinking the address plus the cookie. is the entity name worth adding too?
for a queue that nobody owns yet i would just leave the new fields out.
YL Updated by Yuval Lifshitz 4 months ago
Akshay Nazare wrote in #note-4:
Hii @Yuval Lifshitz makes sense, the lock has everything needed. get_lock_info() on the queue's _lock object returns the locker entity name, the cookie and the address, plus the expiration.
for the next renewal time: the lock only stores the expiration. since the owner writes expiration = now + 3*period and wakes up again at now + period, next renewal = expiration - 2*rgw_topic_ownership_update_period. the caveat is that radosgw-admin would use its own value of that option, so the number would be wrong if the owning gateway runs a different one. is that acceptable, or would you rather report only the expiration?
two questions on the output:
- a persistent topic has 11 shards by default, each with its own lock. normally one gateway owns all of them, but that is not guaranteed. report the owner per shard, or a single owner with a note when they differ?
in a real system with many RGWs, they may be different. please report owner oper shard (even if in some cases its the same owner)
- for the identity i was thinking the address plus the cookie. is the entity name worth adding too?
dont thin kthe cookie is helpful, since ther eis no way to correlate it with the rgw. what is held in "entity name"? also, which address is stored there?
for a queue that nobody owns yet i would just leave the new fields out.
yes
AN Updated by Akshay Nazare 4 months ago
ok, owner per shard, and dropping the cookie.
on what the lock actually holds: cls_lock takes both from cls_get_request_origin(), which is the OSD's view of the request source (objclass.cc:126, cls_lock.cc:177).
entity name is the librados client entity of the radosgw, so client.<global_id>, where global_id is assigned by the monitor when that radosgw's rados handle connects. it changes when the gateway restarts.
address is the radosgw's librados client address, ip:port/nonce, as seen by the OSD. cls_lock forces it to the legacy type before storing it (cls_lock.cc:233), so it prints without a v1/v2 prefix. the ip identifies the host, but the port is the ephemeral messenger port of the rados client, not the S3 frontend port.
so neither field really says "which radosgw" in a way an operator would recognise. cls_lock also has a description field, which rgw_notify currently passes as empty (rgw_notify.cc:721). we could put the daemon id there (cct->_conf->name) and report that as the owner, with the address as a secondary hint. the only downside is that existing locks would have an empty description until their next renewal. would you prefer that, or just the entity name plus address?
one thing from my previous note that is still open: for the next renewal time i can only derive it as expiration - 2*rgw_topic_ownership_update_period, using the value radosgw-admin itself sees. if the owning gateway runs a different value the number will be off. report it anyway with the expiration next to it, or report only the expiration?
YL Updated by Yuval Lifshitz 4 months ago
Akshay Nazare wrote in #note-6:
ok, owner per shard, and dropping the cookie.
on what the lock actually holds: cls_lock takes both from cls_get_request_origin(), which is the OSD's view of the request source (objclass.cc:126, cls_lock.cc:177).
entity name is the librados client entity of the radosgw, so client.<global_id>, where global_id is assigned by the monitor when that radosgw's rados handle connects. it changes when the gateway restarts.
address is the radosgw's librados client address, ip:port/nonce, as seen by the OSD. cls_lock forces it to the legacy type before storing it (cls_lock.cc:233), so it prints without a v1/v2 prefix. the ip identifies the host, but the port is the ephemeral messenger port of the rados client, not the S3 frontend port.
so neither field really says "which radosgw" in a way an operator would recognise. cls_lock also has a description field, which rgw_notify currently passes as empty (rgw_notify.cc:721). we could put the daemon id there (cct->_conf->name) and report that as the owner, with the address as a secondary hint. the only downside is that existing locks would have an empty description until their next renewal. would you prefer that, or just the entity name plus address?
please add that. no issue with being empty until next renewal
one thing from my previous note that is still open: for the next renewal time i can only derive it as expiration - 2*rgw_topic_ownership_update_period, using the value radosgw-admin itself sees. if the owning gateway runs a different value the number will be off. report it anyway with the expiration next to it, or report only the expiration?
just put the expiration
YL Updated by Yuval Lifshitz about 2 months ago
- Status changed from New to Fix Under Review
- Pull request ID set to 71092
UB Updated by Upkeep Bot about 2 months ago
- Copied to Backport #81470: tentacle: notifications: add ownership info to topic stats command added
UB Updated by Upkeep Bot about 2 months ago
- Copied to Backport #81471: umbrella: notifications: add ownership info to topic stats command added
UB Updated by Upkeep Bot about 2 months ago
- Status changed from Fix Under Review to Backporting
- Merge Commit set to 39077b720e95b9211d8b3bdc90067205b4d6e8b1
- Fixed In set to v21.3.0-4050-g39077b720e
- Upkeep Timestamp set to 2026-10-06T11:16:36+00:00