fix(hubble): reset upload quota by job and fix >10GB historical upload blockage#725
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes Hubble’s upload quota behavior so quota is enforced per import job (not across historical jobs) and deleting a job fully releases quota by cleaning up associated tasks, metadata, and disk files.
Changes:
- Frontend: adds current-job cumulative size validation and passes original file size to the backend during chunked upload.
- Backend: validates total quota using current job size and cascades cleanup on job deletion.
- Data model/i18n: exposes raw byte size as
total_size_bytesand clarifies the quota error message.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| hugegraph-hubble/hubble-fe/src/utils/dataImportUpload.ts | Adds helpers to compute current job upload size and enforce the 10GB limit consistently. |
| hugegraph-hubble/hubble-fe/src/stores/types/GraphManagementStore/dataImportStore.ts | Extends FileMapInfo with total_size_bytes for byte-accurate quota calculations. |
| hugegraph-hubble/hubble-fe/src/stores/GraphManagementStore/dataImportStore/dataImportRootStore.ts | Sends size in the upload request so backend can validate original file size. |
| hugegraph-hubble/hubble-fe/src/components/graph-management/data-import/import-tasks/UploadEntry.tsx | Switches UI validation to current-job cumulative size logic. |
| hugegraph-hubble/hubble-be/src/main/resources/i18n/messages_zh_CN.properties | Updates quota error message to clarify “current job” scope. |
| hugegraph-hubble/hubble-be/src/main/resources/i18n/messages.properties | Updates quota error message to clarify “current job” scope. |
| hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java | Adds query method to list file mappings by job for cleanup. |
| hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileMapping.java | Adds total_size_bytes JSON field backed by totalSize. |
| hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/JobManagerController.java | Performs cascading stop/remove of tasks and deletes job files/metadata on job deletion. |
| hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java | Requires size param and validates quota against the current job’s size. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@imbajin Hi, I have made revisions based on your comments. Please take a look again at your convenience. If there are still any issues, please point them out so I can make further changes. Sry, I'm a newcomer, so I appreciate your guidance. |
|
补充一下 comment 里的几个 sec / CodeQL 提示,这边整体看了一遍。 这些告警大多是针对“用户输入参与路径拼接或文件操作”的通用提醒。就这次 PR 来说,核心目标还是修复 upload quota 的统计口径、分片上传时的大小校验,以及删除 job 后配额无法正确释放的问题。从目前代码来看,这条主线已经处理得比较完整了。 考虑到 Hubble 旧版本后续也不再持续维护,我觉得这些 sec 点不用作为这次 PR 的 blocker,更适合作为可选的防御性增强来看。建议只考虑下面几项:
|
|
@imbajin 根据你的建议已经改好了~有空看一下 |
imbajin
left a comment
There was a problem hiding this comment.
THX, maybe could unify CI for the next step (merged the loader-ci improvement PR just now)
Purpose of the PR
This PR fixes the Hubble upload quota reset problem described in #496.
Previously, uploaded file size was effectively accumulated across historical jobs, and deleting an old import job did not fully release the occupied upload quota. As a result, once the historical uploaded files exceeded 10GB, users could no longer continue uploading files in the web UI or reset the quota by removing old jobs.
Main Changes
JobManager.jobSizeinstead of relying on global file history.sizerequest parameter in the upload flow so the backend can validate the original file size instead of only seeing chunk sizes.LoadTaskrecords,FileMappingmetadata, and uploaded files on disk, so deleting an old job can actually release the quota.total_size_bytesas the raw byte field required by frontend quota calculation, remove the redundantjob_size_bytesfield, and deduplicate the related i18n message key.Verifying these changes
git diff --checkto confirm there is no formatting issue in the current diff.Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need