This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new f514c54c41 Fixes rebalance server status rendering (#15554)
f514c54c41 is described below

commit f514c54c413a6ed20bb760a901c3569255f7fa1e
Author: Soumya Himanish Mohapatra 
<30361728+himanish-s...@users.noreply.github.com>
AuthorDate: Thu Apr 17 05:43:49 2025 +0530

    Fixes rebalance server status rendering (#15554)
---
 .../RebalanceServer/RebalanceResponse.tsx          |  2 +-
 .../RebalanceServerResponseLabelValue.tsx          |  2 +-
 .../Operations/RebalanceServerStatusOp.tsx         | 27 +++++++++++++++++-----
 3 files changed, 23 insertions(+), 8 deletions(-)

diff --git 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceResponse.tsx
 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceResponse.tsx
index d9ebf9df1c..573a8556ed 100644
--- 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceResponse.tsx
+++ 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceResponse.tsx
@@ -97,7 +97,7 @@ export const RebalanceResponse = ({ response }) => {
                 responseSectionsToShow.map((section) => {
                     if (Object.keys(response).includes(section.key)) {
                         return (
-                            <Grid item xs={12}>
+                            <Grid item xs={12} key={section.key}>
                                 <RebalanceServerResponseCard>
                                     <RebalanceServerSectionResponse 
key={section.key} sectionTitle={section.name} 
sectionData={response[section.key]} />
                                 </RebalanceServerResponseCard>
diff --git 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerResponses/RebalanceServerResponseLabelValue.tsx
 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerResponses/RebalanceServerResponseLabelValue.tsx
index d12027da41..128c3b397f 100644
--- 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerResponses/RebalanceServerResponseLabelValue.tsx
+++ 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerResponses/RebalanceServerResponseLabelValue.tsx
@@ -25,7 +25,7 @@ export const RebalanceServerResponseLabelValue = (
     return (
         <Box>
             <Typography color='textSecondary' 
variant='caption'>{label}</Typography>
-            <Typography style={{ fontWeight: 600, whiteSpace: "pre" }} 
variant='body2'>{value}</Typography>
+            <Typography style={{ fontWeight: 600, whiteSpace: "pre-wrap", 
wordBreak: "break-all" }} variant='body2'>{value}</Typography>
         </Box>
     );
 }
diff --git 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx
 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx
index 0effe8e0c0..f3abe8c27a 100644
--- 
a/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx
+++ 
b/pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServerStatusOp.tsx
@@ -86,21 +86,36 @@ export const RebalanceServerStatusOp = (
 
     useEffect(() => {
         try {
-            if (jobSelected !== null) {
-                
setRebalanceContext(JSON.parse(rebalanceServerJobs[jobSelected].REBALANCE_CONTEXT))
-                
setRebalanceProgressStats(JSON.parse(rebalanceServerJobs[jobSelected].REBALANCE_PROGRESS_STATS))
+            if (jobSelected !== null && rebalanceServerJobs.length > 0) {
+                const rebalanceServerJob = rebalanceServerJobs
+                    .find(job => job.jobId === jobSelected);
+
+                if (rebalanceServerJob) {
+                    
setRebalanceContext(JSON.parse(rebalanceServerJob.REBALANCE_CONTEXT));
+                    
setRebalanceProgressStats(JSON.parse(rebalanceServerJob.REBALANCE_PROGRESS_STATS));
+                } else {
+                    setRebalanceContext(
+                        {
+                            message: 'Failed to load rebalance context'
+                        });
+                    setRebalanceProgressStats(
+                        {
+                            message: 'Failed to load rebalance progress stats'
+                        });
+                }
+
             }
         } catch (e) {
             setRebalanceContext(
                 {
-                    message: 'Failed to load rebalance context'
+                    message: 'Failed to load rebalance context' + e.toString()
                 });
             setRebalanceProgressStats(
                 {
-                    message: 'Failed to load rebalance progress stats'
+                    message: 'Failed to load rebalance progress stats' + 
e.toString()
                 });
         }
-    }, [jobSelected]);
+    }, [jobSelected, rebalanceServerJobs]);
 
     if (loading) {
         return (


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to