Repository navigation
feat(server): add explicit graph schema clone API - #3439
Conversation
imbajin
left a comment
There was a problem hiding this comment.
[P2] Rebuild inherited parent sort keys instead of copying them at parent creation
A valid base/sub-edge schema with a MULTIPLE child still cannot be cloned. registerInfoToFatherEl() copies the child's sort keys into the existing base label, whose default frequency remains SINGLE. This copy constructor resets the parent's derived links but retains copy.sortKeys(). When SchemaManager.copyFrom() creates the parent first, checkSortKeys() rejects its SINGLE frequency plus nonempty sort keys, so the new schema-clone API fails after creating the target.
Please distinguish child-derived sort keys on a SINGLE parent from valid sort keys explicitly configured on a MULTIPLE parent, preserving the latter, or use a dedicated parent reconstruction path. Add regressions for both parent kinds with a MULTIPLE child, including asBase() plus a withBase(...).multiTimes().properties("time").sortKeys("time") child. The current reversed-order test uses a SINGLE child and does not exercise this case.
Evidence: independent static control-flow review at 2568a1010ead31a3930a92a10998ea3f243b03d9; no live RocksDB/HStore or authenticated request was run in this review.
Source:
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3439 +/- ##
============================================
+ Coverage 57.27% 58.38% +1.11%
+ Complexity 6577 3087 -3490
============================================
Files 776 779 +3
Lines 68881 69393 +512
Branches 9431 9567 +136
============================================
+ Hits 39449 40514 +1065
+ Misses 25804 25198 -606
- Partials 3628 3681 +53
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The schema copy fixes in SchemaManager, EdgeLabelBuilder and IndexLabelBuilder run in CoreTestSuite, but no test of the schema-clone endpoint or cloneGraphSchema runs in CI, because GraphSchemaCloneTest and GraphsApiTest belong to no suite.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The schema-clone endpoint, edge-label preflight and source-ID index fix look correct, but the two new EdgeLabelBuilder tests in GraphSchemaCloneTest fail in the memory-backend unit job, so Server memory tests is red at this head.
| builder.singleTime(); | ||
| builder.ifNotExist(); | ||
|
|
||
| Assert.assertSame(existed, builder.create()); |
There was a problem hiding this comment.
Important: builder.create() takes the DEFAULT-parent-copy_el_update lock, which no test registers, so this test and testMultiParentCreateIgnoresOnlyDerivedLinks fail with LockGroup 'DEFAULT-parent-copy_el_update' does not exists in the unit-test run. Call LockUtil.init("DEFAULT-parent-copy") before these tests and LockUtil.destroy after, as StandardHugeGraphClearBackendTest does.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Score: 9/10. Summary: schema-clone rejects missing sources, extra options and any source edge label before cloneGraph creates the target, and reports a partial target when a copied element is not CREATED; IndexLabelBuilder resolves the copied base label through the source graph, and parent edge labels drop only derived links and SINGLE-parent sort keys. The earlier suite and lock problems are fixed: GraphSchemaCloneTest runs in UnitTestSuite, the endpoint tests run in GraphsApiStandaloneTest, and the memory, RocksDB and HStore jobs pass at this head.
Before
Configuration cloning does not copy schema, and clients lack a supported schema-clone contract.
After
Add synchronous, same-GraphSpace schema-only cloning and correct copied index IDs and parent-edge ordering. Data is not copied; failures may leave a partial target.
Validation and scope
Author-reported validation is recorded in the source PR; independent dots review and exact-head ASF CI are pending. No live deployment or RC acceptance is claimed. Keep Server #361, Toolchain #121 and Doc #58 paired; the new endpoint is unavailable on older Servers.
Source review: hugegraph/hugegraph#361. This PR uses the same source branch; see that discussion for detailed validation evidence and limitations.
Visual overview
版本纠正:Server 实施目标创建前检查与受支持 Schema 复制。本图仅说明同一 GraphSpace、无边标签源图的配置/属性键/顶点标签及其索引复制;不复制顶点或边数据。有边标签的源图由 Server 在创建目标前拒绝,不表示 SDK 独立保证源图状态。复制期间仍需保持源 Schema 不变,失败可能遗留部分目标,没有自动回滚。API 0.73+ 为能力门槛,不代表该版本已发布或联合验收通过。三仓配套:🔗 Server #3439、🔗 Toolchain #870、🔗 Doc #554。机制示意,不代表 CI、独立实测全覆盖或同一 RC 已通过。评审核对:2026-10-31。