Skip to content

feat(store): prototype isolated offline GraphID conversion - #3430

Draft
imbajin wants to merge 7 commits into
apache:masterfrom
hugegraph:feat/graphid-offline-rekey-20261028
Draft

imbajin wants to merge 7 commits into
apache:masterfrom
hugegraph:feat/graphid-offline-rekey-20261028

Conversation

@imbajin

@imbajin imbajin commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Before → After

Before: The startup/snapshot guard can reject ambiguous legacy GraphIDs, but it does not convert physical keys for a 1.7 → 1.8 upgrade.

After: Add an experimental database-level conversion kernel that builds an explicit ownership plan, rewrites GraphID prefixes in an isolated output directory, and reopens and verifies the result before marking it DB_VERIFIED_NOT_CLUSTER_READY. The source is preserved; output is never activated automatically. This avoids treating a mapping-only update or a Server API export/import as physical conversion.

Validation boundary

This is an experimental prototype, not a completed upgrade tool or a merge-readiness claim. Ownership rules must be independently established; successful database checks do not establish cluster readiness. Official 1.7 fixture validation, Raft/snapshot coordination, cluster cutover/rollback, production-scale performance, and the user-facing CLI remain incomplete. This PR does not resolve issue #3224.

At the source head checked for submission, the rekey experiment workflow succeeded, while the official-source fixture workflow failed during source generation; the root cause is unconfirmed. Main CI is still queued. These results do not establish end-to-end upgrade safety.

Source PR: 🔗 hugegraph/hugegraph #353

Visual overview

Experimental isolated offline GraphID conversion

Experimental offline conversion rewrites physical GraphID prefixes into a fresh isolated output using externally established ownership rules, preserves the source, and reopens the candidate for database checks. A successful database check yields DB_VERIFIED_NOT_CLUSTER_READY, never automatic activation. Official 1.7 ownership, Raft/snapshot coordination, replica cutover/rollback, CLI and production-scale qualification remain incomplete.

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 324 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.13%. Comparing base (608cb1d) to head (6f4cfe0).
⚠️ Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
...pache/hugegraph/store/upgrade/GraphIdRewriter.java 0.00% 261 Missing ⚠️
.../hugegraph/store/upgrade/GraphIdMigrationPlan.java 0.00% 63 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3430      +/-   ##
============================================
+ Coverage     57.27%   58.13%   +0.86%     
+ Complexity     6577     3087    -3490     
============================================
  Files           776      781       +5     
  Lines         68881    69717     +836     
  Branches       9431     9640     +209     
============================================
+ Hits          39449    40532    +1083     
+ Misses        25804    25507     -297     
- Partials       3628     3678      +50     
Flag Coverage Δ *Carryforward flag
commons 96.37% <ø> (ø)
hstore 36.07% <ø> (-0.02%) ⬇️
pd 56.80% <ø> (+4.64%) ⬆️
server_hbase 42.18% <ø> (+<0.01%) ⬆️ Carriedforward from 4763973
server_memory 56.53% <ø> (+0.55%) ⬆️
server_rocksdb 43.01% <ø> (+0.35%) ⬆️
store 35.16% <0.00%> (+2.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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: yes. Summary: The official-source workflow this PR adds fails at this head, so it lands a check that is red on every run. The rewrite kernel's source lock, isolated output, plan revalidation and reopen verification read correctly against the GraphIdManager and InnerKeyCreator layouts, and native-rekey passes.

baseline = json.loads((evidence / "fixture-read.json").read_text())
checks = [entry for entry in baseline if entry["step"].startswith("gremlin ")]
if len(checks) != 16 or any(entry["status"] != 200 for entry in checks):
raise RuntimeError("The official source did not pass all 16 fixture requests")

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.

Important: the official-source job in .github/workflows/graphid-official-source.yml fails at this head on this check, so the PR adds a workflow that is red on every run and never produces the 1.7 source it exists for. Fix the fixture run so all 16 Gremlin requests pass, or drop the workflow and script from this PR until they do.

<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.hugegraph</groupId><artifactId>graphid-rekey-probe</artifactId><version>1</version>
<dependencies>
<dependency><groupId>org.rocksdb</groupId><artifactId>rocksdbjni</artifactId><version>8.10.2</version></dependency>

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.

Minor: the GraphIdRewriter probes run only here, against a hard-coded rocksdbjni 8.10.2 and only when these files change, so a rocksdb.version bump in the root pom.xml changes the native library under the shipped kernel without re-running them. Move the probes into hg-store-test as JUnit tests so pd_store / store runs them on the reactor's versions.

@imbajin
imbajin marked this pull request as draft October 31, 2026 17:56
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.

[Bug] HStore: data written by 1.7.0 under the missing graph id 0xFFFE becomes unreachable once master allocates a real graph id

3 participants