brumi1024 commented on PR #8674:
URL: https://github.com/apache/hadoop/pull/8674#issuecomment-5341896606

   Thanks for the fix, and the bug report is valid - the card really does show 
0% for a queue that the RM is giving 3w. But I'd like to suggest a different 
approach, because the current one will keep missing cases.
   
   The root cause is where the card gets its number. `transformToCardData` 
reads capacity through getQueuePropertyValue, which looks into the 
scheduler-conf store - that is the raw configuration a cluster admin wrote. An 
auto-created queue never has its own root.default.user1.capacity key there; the 
RM resolves the template internally 
(AutoCreatedQueueTemplate.setTemplateEntriesForChild) and applies it in memory. 
So any lookup on the config side will come up empty, and the UI falls back to 
'0'.
   
   This PR works around that by rebuilding the template path in the UI 
(<parent>.auto-queue-creation-v2.leaf-template). The problem is that the RM's 
template resolution is more involved than that one key: there are template, 
leaf-template and parent-template with a precedence order, wildcard templates 
like root.default.*.auto-queue-creation-v2.leaf-template.capacity for deeper 
queues, dynamic parent queues that use parent-template, and a default of 1w 
when no template is configured at all 
(AbstractCSQueue.setupConfigurableCapacities). Reimplementing all of that in 
TypeScript means a second copy of the logic that will drift from the RM, the 
main thing I wanted to avoid in the config UI.
   
   The good news is we don't have to: the /ws/v1/cluster/scheduler response 
already contains the RM-computed answer for every queue, and the UI already 
parses it into QueueInfo - look at weight, normalizedWeight and 
queueCapacityVectorInfo.configuredCapacityVector in types/queue.ts. They're 
just not used by the card yet.
   
   So the suggestion: in transformToCardData, when creationMethod is 
dynamicFlexible or dynamicLegacy, take capacity / max capacity from those REST 
fields, and only let a staged config value (isStaged === true) override it, so 
edits still show before apply. That removes the need for the new template-path 
helper entirely, and it fixes wildcard, parent-template and the no-template 
default in one go.


-- 
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