Ren Koike created HDDS-17799:
--------------------------------
Summary: Refine XceiverClientManager pipeline cache keys and
short-circuit client lifecycle
Key: HDDS-17799
URL: https://issues.apache.org/jira/browse/HDDS-17799
Project: Apache Ozone
Issue Type: Improvement
Reporter: Ren Koike
Assignee: Ren Koike
{{XceiverClientManager}} currently mixes normal client caching and
short-circuit read handling inside {{{}getPipelineCacheKey(){}}}. The method
not only builds the {{clientCache}} key, but also discovers the local datanode
for short-circuit reads and stores it in a separate {{localDNCache}} side map
so the client loader can later create an {{{}XceiverClientShortCircuit{}}}.
This makes the cache behavior hard to reason about:
* {{getPipelineCacheKey()}} has side effects beyond key construction.
* {{localDNCache}} duplicates information already discovered while building
the key and is not pruned when {{clientCache}} entries are evicted.
* Short-circuit clients are mixed into the general-purpose client cache even
though they have different lifecycle and validity rules.
* Read acquire/release paths can rebuild cache keys with different
topology-awareness flags.
The goal is to make the client cache identity rules explicit and easier to
maintain.
Proposed change:
* Keep normal gRPC/Ratis/EC clients in {{{}clientCache{}}}.
* Manage the local short-circuit client separately in
{{{}XceiverClientManager{}}}.
* Remove {{{}localDNCache{}}}.
* Make {{getPipelineCacheKey()}} only build the key for cached clients.
* Preserve datanode-specific cache keys where required, such as EC clients and
topology-aware Ratis streaming writes.
* Fix read-data release to use the same cache-key semantics as read-data
acquire.
This should preserve existing behavior while reducing hidden coupling and
making future changes to client caching safer.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]