release-25.4: tenantcapabilitieswatcher: fix nil deref removing placeholder entry#169416
Conversation
The Watcher's getInternal method inserts a placeholder watcherEntry with a nil embedded *Entry pointer when a reader queries capabilities for a tenant not yet seen by the rangefeed. If removeEntryForTenantIDLocked was later called for that tenant, it accessed entry.Name through the nil embedded pointer, causing a panic. This can occur when a rangefeed restart re-delivers a delete event for a tenant whose entry was already removed during a previous rangefeed lifetime. If a reader called GetInfo for that tenant in the interim, the store contains only the nil-Entry placeholder, and the re-delivered delete dereferences it. Epic: none Release note (bug fix): Fixed a rare nil pointer dereference panic in the tenant capabilities watcher that could occur when a tenant entry was removed before it was fully populated by the rangefeed. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
|
Thanks for opening a backport. Before merging, please confirm that it falls into one of the following categories (select one):
Add a brief release justification to the PR description explaining your selection. Also, confirm that the change does not break backward compatibility and complies with all aspects of the backport policy. All backports must be reviewed by the TL and EM for the owning area. |
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link) |
Backport 1/1 commits from #168391 on behalf of @stevendanna.
The Watcher's getInternal method inserts a placeholder watcherEntry
with a nil embedded *Entry pointer when a reader queries capabilities
for a tenant not yet seen by the rangefeed. If removeEntryForTenantIDLocked
was later called for that tenant, it accessed entry.Name through the nil
embedded pointer, causing a panic.
This can occur when a rangefeed restart re-delivers a delete event for
a tenant whose entry was already removed during a previous rangefeed
lifetime. If a reader called GetInfo for that tenant in the interim,
the store contains only the nil-Entry placeholder, and the re-delivered
delete dereferences it.
Epic: none
Release justification: