HDDS-14913. Implement Scalable CSV Export for Unhealthy Containers in Recon UI.#10162
Draft
ArafatKhan2198 wants to merge 2 commits intoapache:masterfrom
Draft
HDDS-14913. Implement Scalable CSV Export for Unhealthy Containers in Recon UI.#10162ArafatKhan2198 wants to merge 2 commits intoapache:masterfrom
ArafatKhan2198 wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
|
@ArafatKhan2198 as discussed, please design the solution server based for single Recon user. We don't have user based logins in Recon. We should not localize the logic at browser for job progress. All browser windows opened in multiple machines opening the recon page should see the same job and its progress. At a time only job should be allowed to run and remaining 2 should go in queue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The Recon UI had no way for administrators to export unhealthy container data (Missing, Under-Replicated, Over-Replicated, etc.) at scale. For clusters with millions of containers, any streaming export over a long-running HTTP connection would be killed by network infrastructure (firewalls, load balancers, proxies) before completion.
Solution: Asynchronous Background Export with Queue
Instead of streaming data directly to the browser, this PR implements a server-side background job system that:
Backend Changes
New:
ExportJobmodel (ExportJob.java)A data class representing one export job with fields:
jobId(UUID),userId,state(container state),status(QUEUED → RUNNING → COMPLETED/FAILED)queuePosition,totalRecords,estimatedTotal,progressPercentfilePath(path to TAR on disk),submittedAt,startedAt,completedAt,errorMessageNew:
ExportJobManager.java— the core engineA Guice Singleton that runs for the lifetime of the Recon server:
part001.csv,part002.csv)Archiver.create()intoexport_{state}_{userId}_{shortJobId}.tarCOUNT(*)before the cursor opens to calculateestimatedTotal;totalRecordsincrements livesubmitJob()— prevents race conditions when multiple users submit simultaneouslygetQueuePosition()— walksLinkedHashMap(insertion-order) to return 1-indexed positionContainerEndpoint.java— new REST endpointsQueue-full (429) errors return JSON instead of Jetty's HTML error page.
ContainerHealthSchemaManager.javagetUnhealthyContainersCursor()— jOOQ lazy cursor for streaming DB records without holding them all in JVM heapgetUnhealthyContainersCount()— fastCOUNT(*)used before the cursor opens for progress estimationReconServerConfigKeys.javaNew config keys:
ozone.recon.export.worker.threads(default: 1)ozone.recon.export.directory(default:/tmp/recon/exports)ozone.recon.export.max.jobs.total(default: 10)Frontend Changes (
containers.tsx,container.types.ts)New: Export Tab (tab key
'6')A dedicated Export tab is added to the Containers page alongside Missing, Under-Replicated, etc. It contains:
Submit Controls:
Active Exports table (hidden when empty):
#1,#2...), Progress bar + record countCompleted Exports table (always visible, paginated):
MMM D, HH:mm:ssPolling:
setInterval+useRef— starts when Export tab is opened or a job is submittedError handling:
- 429 queue-full error shows a 6-second toast with the specific message
- All errors show clean messages (no raw HTML from Jetty)
- Guard in
## What is the link to the Apache JIRAfetchTabDatapreventsundefinedAPI calls when Export tab is activehttps://issues.apache.org/jira/browse/HDDS-14913
How was this patch tested?
Log Changes -
CSV_Export_Feature.mp4