Skip to content

HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector#10677

Merged
ArafatKhan2198 merged 1 commit into
apache:masterfrom
anuragp010:hdds-14544
Jul 7, 2026
Merged

HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector#10677
ArafatKhan2198 merged 1 commit into
apache:masterfrom
anuragp010:hdds-14544

Conversation

@anuragp010

@anuragp010 anuragp010 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

2 Independent issues are present in the omDBInsights page when we change the value for limit.

1. 2 API calls are made per tab endpoint when we change the limit:
Root Cause:

  • Each OM DB Insights tab uses the useApiData hook to fetch data. This hook also refetches the data when there is change in the URL string.
  • Each tab also defines a separate useEffect hook that refetches the data through useApiData when limit.value changes.
  • By behaviour, changing the limit results in changing the URL string. As a result, we have 2 listeners - one is useApiData listening to changes in URL string and the other in the same Table listening to limit.value changes. This results in 2 calls to useApiData.

Fix:
The redundant useEffect in the OMDBInsights tab pages, which listens to limit.value changes was removed.

2. Changing the limit results in fetching data for all 5 tab endpoints even though only one tab is active:
Root Cause:

  • Limit's state lives in the parent and is shared across all tabs.
  • Ant Design Tabs mounts the tab content on the first visit to a tab. These tabs remain mounted even when inactive (default behaviour of Ant design tabs).
  • Changing the limit, results in changing the state for all tabs which are mounted, resulting in refetching data for all tabs.

Fix:
Unmount inactive tabs from the ant design tabs using the destroyInactiveTabPane prop.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14544

How was this patch tested?

Network Tab in browser.

Before the changes:
image

  • All tabs on the OMDBInsights page are opened once.
  • Limit is changed resulting in 2 API calls per tab, for all tabs.

After the changes:
image

  • All tabs on the OMDBInsights page are opened once.
  • Limit is changed resulting in a single API call for the active tab.

@jojochuang jojochuang requested a review from spacemonkd July 6, 2026 16:11

@ArafatKhan2198 ArafatKhan2198 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @anuragp010
Changes LGTM +1
Just one change in the desc - It says "change in the URL" - really it's the url string passed to useApiData (e.g. /api/v1/...?limit=${limit.value}), not browser location via react-router. Minor wording fix.

@anuragp010

Copy link
Copy Markdown
Contributor Author

Thanks for working on this @anuragp010 Changes LGTM +1 Just one change in the desc - It says "change in the URL" - really it's the url string passed to useApiData (e.g. /api/v1/...?limit=${limit.value}), not browser location via react-router. Minor wording fix.

Thank you for the review @ArafatKhan2198 . I have updated the description with the suggested fix.

@ArafatKhan2198 ArafatKhan2198 merged commit 38e19ec into apache:master Jul 7, 2026
39 checks passed
errose28 added a commit to errose28/ozone that referenced this pull request Jul 7, 2026
* master: (519 commits)
  HDDS-14544. OM DB Insights: Duplicate API calls triggered when changing limit selector (apache#10677).
  HDDS-15587. [Recon] Show 0 for offline DN pending deletion instead of -1 (apache#10585).
  HDDS-15521. StreamBlockInputStream fails with TimeoutIOException without retry or failover. (apache#10479)
  HDDS-15170. Add mock-based unit tests for DataStream write path (apache#10230)
  HDDS-15552. Ratis events should not be published as metrics (apache#10523)
  HDDS-15746. Bump kerby to 2.1.2 (apache#10666)
  HDDS-15579. Replace SimpleSpanProcessor with BatchSpanProcessor (apache#10569)
  HDDS-15747. Address review comments for HDDS-15083 (apache#10669)
  HDDS-15732. Some ozone commands ignore OZONE_MODULE_ACCESS_ARGS (apache#10655)
  HDDS-15605. Fix flaky testContainerExclusionWithClosedContainerException (apache#10621)
  HDDS-11855. Fix flaky TestContainerBalancerDatanodeNodeLimit#checkIterationResultException (apache#10667)
  HDDS-15741. Bump awssdk to 2.46.17 (apache#10661)
  HDDS-10307. Speed up TestOzoneManagerHAWithStoppedNodes (apache#10658)
  HDDS-15651. Test case for DiskBalancer when markContainerForDelete fails (apache#10593)
  HDDS-15742. Bump nimbus-jose-jwt to 10.9.1 (apache#10662)
  HDDS-15719. Add check for allowed action usage in workflows (apache#10641)
  HDDS-15744. Bump javassist to 3.32.0-GA (apache#10665)
  HDDS-15737. Fix intermittent failure in balancerShouldOnlySelectConfiguredIncludeContainers (apache#10660)
  HDDS-15743. Bump gson to 2.14.0 (apache#10664)
  HDDS-11093. Fix intermittent failure in TestContainerBalancerDatanodeNodeLimit#testMetrics (apache#10659)
  ...

Conflicts:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerScanHelper.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants