imbajin opened a new pull request, #3391: URL: https://github.com/apache/hugegraph/pull/3391
## Purpose of the PR Graph-space cards can remain at zero after writes, newly bootstrapped DEFAULT spaces use effectively unlimited quotas, and peer Servers retain deleted spaces in their local caches. ## Main Changes - Preserve reported usage when the PD REST/gRPC limit endpoints update a quota. Store limits in GB and merge KB usage under a lock shared by service facades, using exact-key reads. Refresh usage even without a Server configuration in the default cluster, count leader copies, and reset empty spaces to zero. - Keep integer-GB `storage_used` for compatibility and add `storage_used_kb`; compute the ratio without prematurely rounding away small usage. - Give new spaces, including DEFAULT, finite defaults: 128 CPU cores, 128 GB memory, 128 compute cores, 128 GB compute memory, 10240 GB storage, 100 graphs and 100 roles. Omitted API compute fields inherit the request's CPU/memory limits; explicit values, including zero's Kubernetes inheritance rule, are preserved. Existing persisted quotas are preserved. - Register graph-space removal notifications and evict peer space/service caches without repeating destructive cleanup. Refresh a recreated space from current metadata and discard its old service cache when a delayed removal arrives. Paired Toolchain PR: https://github.com/hugegraph/hugegraph-toolchain/pull/81 The Toolchain PR carries the optional usage field through the Java client and Hubble and updates the creation form/display. ## Verifying these changes - [x] Added regression coverage: 8 Server tests and 5 PD tests pass, including cross-facade races, GB limit preservation, recreated-space cache replacement and API compute defaults. - [x] `mvn editorconfig:format` and full `mvn clean compile -Dmaven.javadoc.skip=true` pass with JDK 17. - [x] Targeted reactor tests: `GraphManagerClearGraphSpaceTest,GraphSpaceInfoLocaleTest,GraphSpaceUsageTest`, with `unit-test,pd-core-test`. - Live multi-Server deployment testing was not run; peer notification behavior is covered with two manager replicas and captured metadata listeners. ## Does this PR potentially affect the following parts? - [ ] Dependencies - [x] Modify configurations: defaults for newly created spaces only - [x] The public API: additive `storage_used_kb` response field and finite defaults for omitted creation resources - [x] Other affects: metadata removal notifications - [ ] Nope ## Documentation Status - [x] Doc - Done: `docs/server-runtime.md`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **功能** * 图空间用量按分区 Leader 副本统计,并定期更新;无图空间时用量会更新为零。 * 图空间信息新增 KB 级精确用量和更精确的存储使用百分比;现有整数 GB 用量字段保留。 * 新建图空间采用有限资源默认值;修改存储限额时保留已有用量。 * 删除图空间后,各 Server 会清理本地缓存;若同名空间已重建,延迟的删除通知不会影响新空间。既有空间配置在重启后保留。 * **文档** * 补充图空间存储用量统计、配额更新及删除行为说明。 <!-- end of auto-generated comment: release notes by coderabbit.ai --> ## 图解  图空间用量、配额与删除同步:Leader 副本近似用量经 Store 心跳与 PD 周期汇总上报;新空间采用有限默认配额;删除通知仅清理本地缓存,并保护同名重建空间。实现示意,不代表真实多 Server 验收通过。 --- Source community PR: https://github.com/hugegraph/hugegraph/pull/328. This upstream draft reuses the same branch. Figure PR numbers refer to that community source. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
