diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java index 91926b5d41..1b3bbeccc6 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java @@ -124,6 +124,7 @@ private void listenChanges() { schema.name()); this.nameCache.invalidate(prefixedName); } + this.resetCachedAll(type); return true; } else if (ACTION_CLEAR.equals(args[0])) { this.clearCache(); @@ -137,6 +138,11 @@ private void listenChanges() { } } + private final void resetCachedAll(HugeType type) { + // Set the cache all flag of the schema type to false + this.cachedTypes().put(type, false); + } + private void clearCache() { this.idCache.clear(); this.nameCache.clear(); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java index 670cd6a627..42cfefb37b 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/raft/StoreStateMachine.java @@ -196,7 +196,7 @@ private void applyCommand(StoreType type, StoreAction action, @Override public void onSnapshotSave(SnapshotWriter writer, Closure done) { - LOG.debug("The node {} start snapshot save", this.node().nodeId()); + LOG.info("The node {} start snapshot saving", this.node().nodeId()); this.snapshotFile.save(writer, done, this.context.snapshotExecutor()); } @@ -206,6 +206,12 @@ public boolean onSnapshotLoad(SnapshotReader reader) { LOG.warn("Leader is not supposed to load snapshot."); return false; } + /* + * Snapshot load occured in RaftNode constructor, specifically at step + * `this.node = this.initRaftNode()`, at this time the NodeImpl is null + * in RaftNode so we can't call `this.node().nodeId()` + */ + LOG.info("The node {} start snapshot loading", this.context.endpoint()); return this.snapshotFile.load(reader); } diff --git a/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java b/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java index ae1844d6fd..713aa251b8 100644 --- a/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java +++ b/hugegraph-rocksdb/src/main/java/com/baidu/hugegraph/backend/store/rocksdb/RocksDBOptions.java @@ -65,9 +65,9 @@ public static synchronized RocksDBOptions instance() { "rocksdb.data_disks", false, "The optimized disks for storing data of RocksDB. " + - "The format of each element: `STORE/TABLE: /path/to/disk`." + - "Allowed keys are [graph/vertex, graph/edge_out, graph/edge_in, " + - "graph/secondary_index, graph/range_index]", + "The format of each element: `STORE/TABLE: /path/disk`." + + "Allowed keys are [g/vertex, g/edge_out, g/edge_in, " + + "g/secondary_index, g/range_index]", null, String.class, ImmutableList.of()