Skip to content

Commit

Permalink
Fix add schema from follower then list all without it (#1325)
Browse files Browse the repository at this point in the history
Change-Id: Iad9d80cabb3d6a874ac66c52de22cc2682debfca
  • Loading branch information
Linary authored Jan 14, 2021
1 parent e0f36bd commit 0dc1535
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0dc1535

Please sign in to comment.