Skip to content

docs: explain loader mode ownership - #525

Open
imbajin wants to merge 5 commits into
apache:masterfrom
hugegraph:fix/doc-loader-mode-owners
Open

imbajin wants to merge 5 commits into
apache:masterfrom
hugegraph:fix/doc-loader-mode-owners

Conversation

@imbajin

@imbajin imbajin commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

中文说明 (Chinese Summary)

背景与目标

在数据导入过程中,为防止多个 Loader 进程并发导入时相互覆盖图模式(Mode)状态,HugeGraph 引入了 LOADING 模式所有权 (Ownership) 机制。本 PR 同步完善 RESTful API 和 HugeGraph-Loader 的双语使用文档。

主要改动

  1. RESTful API 参考 (graphs.md):
    • 新增 6.3.5 LOADING 所有权 小节:说明 /graphspaces/{space}/graphs/{graph}/mode/owners 接口的申请(acquire)与释放(release)协议。
    • 明确状态约束:当存在活跃的 Loader 所有者时,传统的 PUT /mode 枚举修改接口会被拒绝。
  2. HugeGraph-Loader 指南 (hugegraph-loader.md):
    • 新增 3.4.6 并发导入与 LOADING 所有权 小节。
    • 平滑降级机制:升级后的 Loader 仅在探测返回路由级 404(即对接未支持该接口的旧版 Server)时,才会自动降级为旧版枚举模式;其余错误(鉴权失败、网络异常等)均直接报错退出,避免脏状态。
    • 异常恢复操作:补充未正常退出(如 kill -9)或句柄丢失时的手动 REST 释放及 Server 重启恢复指引。

边界与注意事项

  • 保护范围:仅保护直连同一 Server 实例的普通 Loader 进程,防止模式被意外重置。
  • 不支持场景:不提供跨 Server 的分布式锁协调,不提供数据写入级的事务隔离,所有权不设自动租约过期时间。
  • 不受影响流程:旧版 Server、图数据源导入以及恢复导入(Restore)保持原有枚举模式行为。

English Description

Summary

Update bilingual documentation for Loader concurrent import protection and LOADING mode ownership:

  • Document the new /mode/owners RESTful APIs and handle lifecycle.
  • Clarify Loader fallback boundaries and operational recovery steps.

Key Changes

  1. RESTful API Reference (graphs.md):
    • Added 6.3.5 LOADING ownership: documents GET/PUT /graphspaces/{space}/graphs/{graph}/mode/owners (acquire / release actions).
    • Clarified mode restrictions: legacy PUT /mode is rejected while active owners hold the graph.
  2. HugeGraph-Loader Guide (hugegraph-loader.md):
    • Added 3.4.6 Concurrent imports and LOADING ownership.
    • Fallback behavior: upgraded Loader only falls back to legacy enum mode on a route-level 404 (older Server); other errors (network, auth, acquire fail) fail immediately.
    • Recovery: documented manual REST release retries and handling of ungraceful exits (kill -9).

Scope & Boundaries

  • Scope: protects ordinary Loader processes connected to a single Server instance.
  • Not included: does not provide cross-Server distributed coordination, data write isolation, or automatic owner lease expiry.
  • Unchanged flows: older Servers, graph-source, and restore imports keep their legacy behavior.

Related Implementation PRs

Verification

  • Hugo 0.165 Extended bilingual build passed
  • Markdown links & anchors validated (dist/validate-links.sh)

- document protocol 1 and matching client/server requirements
- describe fixed owner lifecycle and permissions
- clarify abnormal exit recovery and deployment limits

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Independent current-head documentation review:8/10. REST owner semantics match the proposed Server; the Loader build-availability qualification remains open.

Comment thread content/en/docs/quickstart/toolchain/hugegraph-loader.md Outdated
- qualify owner protection as proposed and unreleased
- pin paired Server and Client/Loader sources
- explain restore capability checks and drained cleanup
- preserve old Server import behavior
- scope ownership to ordinary imports
- clarify manual owner-release recovery
- keep Hubble cleanup in a separate change
@imbajin
imbajin marked this pull request as ready for review October 13, 2026 16:34

@bitflicker64 bitflicker64 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.

Blocking: no. Summary: The REST and Loader text matches the paired implementations at their current heads, and the EN and CN pages agree; the inline comments cover four small gaps. The pages describe Server #3331 and Client/Loader #815 as unmerged, so please merge this after those two and then replace the wording about current master with the release that carries the feature. Evidence: read the full diff at 4ff825c (4 files, +155/-0); compared it with LoadingMode.java, GraphsAPI.java, HugeGraphAuthProxy.java and StandardHugeGraph.java in apache/hugegraph#3331 at 4a42a77, and with LoadContext.java, HugeGraphLoader.java and LoadingModeOwner.java in apache/hugegraph-toolchain#815 at 63cfd76; checked the mode setter roles on apache/hugegraph master 0b7c0de3e; checked that sections 6.3.5 and 3.4.6 follow the existing numbering and that both #loading-ownership anchors exist for the two cross-page links. No Hugo build was run locally; the Build group 0 check was still queued.

Comment thread content/en/docs/clients/restful-api/graphs.md
Comment thread content/en/docs/clients/restful-api/graphs.md Outdated
Comment thread content/cn/docs/clients/restful-api/graphs.md Outdated
Comment thread content/en/docs/quickstart/toolchain/hugegraph-loader.md Outdated

This branch has not been deployed

No deployments
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