You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "userhimanshuverma (via GitHub)" <gi...@apache.org> on 2025/07/28 19:50:01 UTC

[PR] Fix: Handle null values in ZooKeeper node metadata in Pinot UI #14216 [pinot]

userhimanshuverma opened a new pull request, #16440:
URL: https://github.com/apache/pinot/pull/16440

   #### **Issue**
   
   When browsing ZooKeeper nodes via the Pinot Controller UI (`Zookeeper Browser` tab), the UI crashes with the following error in the console:
   
   Related to #14216
   
   
   ```
   Uncaught (in promise) TypeError: Cannot read properties of null (reading 'numChildren')
   ```
   
   This issue occurs when `currentNodeListStat[pathName]` is `null` or `undefined`, which can happen for certain ZNodes that exist but don’t have associated stat metadata (e.g., if there was a permission issue or deletion in progress).
   
   This results in a **blank screen** and an unusable UI in certain scenarios. Screenshots showing the behavior:
   
   * Working cluster shows a warning for `null` nodes:
     ![Cluster 1 - Warning for null](attachment:67fbc533-6e0e-4303-afcd-6be8b0c50c6d.png)
   
   * Failing cluster crashes on the same condition:
     ![Cluster 2 - Blank screen](attachment:96b06541-650e-4ea9-88fc-701095faf32c.png)
   
   ---
   
   #### **Root Cause**
   
   The existing logic assumes all `currentNodeListStat[pathName]` values are valid objects, and directly accesses `numChildren`. However, in real-world deployments, `null` values can be returned by ZooKeeper API due to inconsistent state or authorization limitations.
   
   ---
   
   #### **Fix**
   
   Updated the `getZookeeperData` function in `PinotMethodUtils.ts` to:
   
   * Check if `currentNodeListStat[pathName]` is `null` or `undefined`
   * Gracefully skip such nodes while logging a warning for visibility
   * Avoids UI crashes and ensures the rest of the node tree loads properly
   
   **Updated code snippet:**
   
   ```js
   pathNames.forEach((pathName) => {
     const nodeStat = currentNodeListStat[pathName];
   
     // Skip if nodeStat is null or undefined
     if (!nodeStat) {
       console.warn(`Skipping null node for path: ${pathName}`);
       return;
     }
   
     newTreeData[0].child.push({
       nodeId: `${counter++}`,
       label: pathName,
       fullPath: path === '/' ? path + pathName : `${path}/${pathName}`,
       child: [],
       isLeafNode: nodeStat.numChildren === 0,
       hasChildRendered: false
     });
   });
   ```
   
   ---
   
   #### **Impact**
   
   * Prevents UI from crashing on malformed or permission-limited ZooKeeper nodes
   * Allows continued navigation of valid nodes
   * Adds debug logging for `null` node cases to aid further troubleshooting
   
   #### **Issue Screenshot**
   <img width="1512" height="903" alt="image" src="https://github.com/user-attachments/assets/40e505ba-78fb-4674-ab56-a9583939745f" />
   
   #### **After Fix Screenshot**
   <img width="1512" height="904" alt="image" src="https://github.com/user-attachments/assets/15394423-d61e-41d6-b3a4-f8a9a505fa6a" />
   
   


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Fix: Handle null values in ZooKeeper node metadata in Pinot UI #14216 [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16440:
URL: https://github.com/apache/pinot/pull/16440#issuecomment-3129733626

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/16440?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 56.34%. Comparing base ([`1a476de`](https://app.codecov.io/gh/apache/pinot/commit/1a476dea72ebf1c15e14ded28ae60c385f71b2c3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4a64cb2`](https://app.codecov.io/gh/apache/pinot/commit/4a64cb24e8f6eb6700053f231209468895215c98?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 519 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (1a476de) and HEAD (4a64cb2). Click for more details.
   > 
   > <details><summary>HEAD has 64 uploads less than BASE</summary>
   >
   >| Flag | BASE (1a476de) | HEAD (4a64cb2) |
   >|------|------|------|
   >|java-21|10|1|
   >|unittests|6|2|
   >|unittests1|3|2|
   >|skip-bytebuffers-true|4|0|
   >|temurin|15|2|
   >|unittests2|3|0|
   >|skip-bytebuffers-false|8|0|
   >|java-11|5|1|
   >|integration|9|0|
   >|integration2|3|0|
   >|integration1|3|0|
   >|custom-integration1|3|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #16440      +/-   ##
   ============================================
   - Coverage     62.90%   56.34%   -6.57%     
   + Complexity     1386      700     -686     
   ============================================
     Files          2867     2350     -517     
     Lines        163354   129485   -33869     
     Branches      24952    20590    -4362     
   ============================================
   - Hits         102755    72952   -29803     
   + Misses        52847    50529    -2318     
   + Partials       7752     6004    -1748     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.27% <ø> (-6.60%)` | :arrow_down: |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.29% <ø> (-6.53%)` | :arrow_down: |
   | [skip-bytebuffers-false](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [skip-bytebuffers-true](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <ø> (-6.57%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <ø> (-6.56%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.34% <ø> (+0.51%)` | :arrow_up: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/16440/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/16440?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Fix: Handle null values in ZooKeeper node metadata in Pinot UI #14216 [pinot]

Posted by "userhimanshuverma (via GitHub)" <gi...@apache.org>.
userhimanshuverma commented on PR #16440:
URL: https://github.com/apache/pinot/pull/16440#issuecomment-3131213152

   @yashmayya Could you please merge this PR? The changes have been approved by @jayeshchoudhary.


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Fix: Handle null values in ZooKeeper node metadata in Pinot UI #14216 [pinot]

Posted by "userhimanshuverma (via GitHub)" <gi...@apache.org>.
userhimanshuverma commented on PR #16440:
URL: https://github.com/apache/pinot/pull/16440#issuecomment-3129319848

   @jayeshchoudhary @Jackie-Jiang
   Requesting your review on this. Please feel free to share any feedback or let me know if you have any questions.


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Fix: Handle null values in ZooKeeper node metadata in Pinot UI #14216 [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #16440:
URL: https://github.com/apache/pinot/pull/16440


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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