eubnara opened a new pull request, #4135:
URL: https://github.com/apache/ambari/pull/4135

   ## What changes were proposed in this pull request?
   
   Speeds up propagation of config / config-group changes to agents on large
   clusters (AMBARI-26614). Previously every change recomputed the per-host 
agent
   config for all cluster hosts, sequentially and redundantly, and a 
config-group
   change touching only a few member hosts still pushed config to every host.
   
   - Scope config-group create/update to the affected member hosts (union of
     previous and new members). New `ConfigHelper.updateAgentConfigs(Cluster,
     List<Long> hostIds)` overload; the cluster-wide
     `updateAgentConfigs(Set<String>)` is kept as a wrapper.
   - Cache `Cluster#getDesiredConfigs` per batch instead of recomputing per 
host.
   - Parallelize per-host recomputation on the existing `ThreadPools` 
ForkJoinPool
     (no new/leaked pool); wait for completion and surface per-host failures.
   - Drop the unnecessary deep sorting of the agent payload (`ClusterConfigs`
     SortedMap → Map; agents don't depend on key order).
   - Look up config groups by host id instead of scanning by hostname.
   - Remove the leftover config-name unescaping. AMBARI-23463 added an
     escape/unescape pair for config names; AMBARI-23538 removed the escaping
     half, leaving the unescaping half with nothing to undo. It still ran on 
every
     key for every host on every push (wasted work on the hot path), and since
     nothing escapes the keys anymore it corrupted any key containing a 
backslash
     sequence. Output is unchanged for normal keys.
   
   Cluster-wide config changes still target all hosts; the hash-based
   "send only if changed" mechanism is unchanged.
   
   ## How was this patch tested?
   
   Existing unit tests pass: `ConfigHelperTest`, 
`ConfigGroupResourceProviderTest`.
   `ConfigHelperTest` was updated to stub `ServiceComponentHost#getHost()` for 
the
   config-group-by-hostId lookup path. Manually verified on a large cluster 
that a
   config-group change pushes config only to its member hosts.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to