Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6fc8775
fix(store): guard legacy GraphID upgrades
imbajin Oct 19, 2026
e9a4392
fix(store): fail GraphID check without explicit mode
imbajin Oct 23, 2026
0659e28
test(store): require explicit GraphID check mode
imbajin Oct 23, 2026
f1a5030
docs(store): remove one-off GraphID validation receipts
Oct 23, 2026
2e85419
Merge remote-tracking branch 'refs/remotes/organization/master' into …
Oct 25, 2026
59f41ba
fix(store): preserve runtime and startup boundaries in upgrade checks
Oct 25, 2026
9bc3296
docs(store): explain recovery from incomplete database remnants
Oct 25, 2026
705c0b0
Merge commit 'a8fac1bc88a67d6cf85ca40c9885d7daadaaa0f0' into review/s…
Oct 25, 2026
ff7df0e
fix(store): lock startup GraphID preflight databases
imbajin Oct 25, 2026
db3f643
fix(store): preserve incomplete database diagnostics
imbajin Oct 25, 2026
989d532
docs(store): remove review coordination links
Oct 28, 2026
9c1a05b
fix(store): reject incomplete metadata preflight
imbajin Oct 28, 2026
2753df9
Merge branch 'master' into fix/graphid-upgrade-guard
imbajin Oct 28, 2026
827e6c1
fix(store): harden preflight metadata checks
imbajin Oct 28, 2026
f17491d
Merge ASF master into GraphID upgrade guard
imbajin Nov 8, 2026
47fe808
fix(store): harden GraphID preflight coverage and checkpoint checks
imbajin Nov 8, 2026
4e45358
fix(store): report unverified partition paths in offline checks
imbajin Nov 8, 2026
e3f411a
test(server): publish fixture exit status atomically
imbajin Nov 8, 2026
7fe3a5b
Merge branch 'apache:master' into codex/asf-graphid-upgrade-guard-202…
imbajin Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ apache-hugegraph-*/
**/docker-compose*.yaml
**/*.md
docs/
# The Store assembly packages this upgrade guide.
!docs/
docs/*
!docs/graphid-upgrade.md
3 changes: 3 additions & 0 deletions .github/workflows/pd-store-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ jobs:
run: |
mvn editorconfig:check -pl hugegraph-store/hg-store-test -am -ntp

- name: Check Store GraphID checker launcher
run: bash hugegraph-store/hg-store-dist/src/assembly/travis/test-store-check-launcher.sh

- name: Run Store docker entrypoint rocksdb memory tests
run: |
$TRAVIS_DIR/test-store-docker-entrypoint.sh
Expand Down
277 changes: 277 additions & 0 deletions docs/graphid-upgrade.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ sys.exit(int((work / 'child-exit').read_text()))
os.kill(int((work / 'bin/pid').read_text()), signal.SIGKILL)
else:
status = 42 if mode in ['partition42', 'partitionDiagnostic42'] else int(mode[4:])
(work / 'child-exit').write_text(str(status))
# Publish the exit code only after its contents are complete.
pending_exit = work / 'child-exit.tmp'
pending_exit.write_text(str(status))
pending_exit.replace(work / 'child-exit')
actual = process.wait(timeout=5)
assert actual == expected, (mode, expected, actual, (work / 'output').read_text())
diagnostic = (work / 'output').read_text()
Expand Down
4 changes: 4 additions & 0 deletions hugegraph-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ For detailed architecture, Raft consensus mechanisms, and partition management,
For lightweight Raft dashboard counters and the detailed metrics contract, see
[Store monitoring metrics](docs/monitoring.md).

## Upgrading from 1.7

Before starting 1.8 on existing HStore data, follow the [GraphID upgrade checks and recovery guide](../docs/graphid-upgrade.md). The Store distribution includes a read-only `bin/hugegraph-store-check.sh --check` command.

## Quick Start

### Prerequisites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -115,13 +116,15 @@
import org.apache.hugegraph.store.schema.SchemaGraph;
import org.apache.hugegraph.store.term.Bits;
import org.apache.hugegraph.store.term.HgPair;
import org.apache.hugegraph.store.upgrade.LegacyGraphIdChecker;
import org.apache.hugegraph.store.util.DefaultThreadFactory;
import org.apache.hugegraph.store.util.ExecutorUtil;
import org.apache.hugegraph.store.util.HgStoreException;
import org.apache.hugegraph.structure.BaseElement;
import org.apache.hugegraph.util.Bytes;
import org.rocksdb.Cache;
import org.rocksdb.MemoryUsageType;
import org.rocksdb.RocksDBException;

import com.alipay.sofa.jraft.util.Utils;
import com.google.protobuf.ByteString;
Expand Down Expand Up @@ -1194,6 +1197,17 @@ public void saveSnapshot(String snapshotPath, String graph, int partId) throws
@Override
public void loadSnapshot(String snapshotPath, String graph, int partId, long v1) throws
HgStoreException {
// Validate incoming data before getSession() can create or prune local DB versions.
try {
LegacyGraphIdChecker.checkDatabase(Path.of(snapshotPath), factory.getHugeConfig());
} catch (IOException | RocksDBException | IllegalStateException e) {
HgStoreException failure = new HgStoreException(
HgStoreException.EC_RKDB_IMPORT_SNAPSHOT_FAIL,
"GraphID upgrade preflight rejected snapshot %s for partition %d: %s",
snapshotPath, partId, e.getMessage());
failure.initCause(e);
throw failure;
}
try (RocksDBSession dbSession = getSession(graph, partId)) {
dbSession.loadSnapshot(snapshotPath, v1);
keyCreator.clearCache(partId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ public void onSnapshotSave(final SnapshotWriter writer, final Closure done) {

@Override
public boolean onSnapshotLoad(final SnapshotReader reader) {
final long snapshotIndex;
try {
RaftOutter.SnapshotMeta meta = reader.load();
if (meta != null) {
this.committedIndex = meta.getLastIncludedIndex();
log.info("onSnapshotLoad committedIndex = {}", this.committedIndex);
snapshotIndex = meta.getLastIncludedIndex();
} else {
log.error("onSnapshotLoad failed to get SnapshotMeta");
return false;
Expand All @@ -241,8 +241,9 @@ public boolean onSnapshotLoad(final SnapshotReader reader) {
return false;
}
try {
snapshotHandler.onSnapshotLoad(reader, this.committedIndex);
log.info("Raft {} onSnapshotLoad success", groupId);
snapshotHandler.onSnapshotLoad(reader, snapshotIndex);
this.committedIndex = snapshotIndex;
log.info("Raft {} onSnapshotLoad success, committedIndex = {}", groupId, snapshotIndex);
return true;
} catch (HgStoreException e) {
log.error(String.format("Raft %s onSnapshotLoad failed. ", groupId), e);
Expand Down
Loading
Loading