imbajin commented on code in PR #3329:
URL: https://github.com/apache/hugegraph/pull/3329#discussion_r4276310990
##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/core/GraphManager.java:
##########
@@ -2627,41 +2839,64 @@ private <T> void graphAddHandler(T response) {
continue;
}
LOG.info("Accept graph add signal from etcd for {}", graphName);
- if (this.graphs.containsKey(graphName) ||
- this.creatingGraphs.contains(graphName)) {
- this.creatingGraphs.remove(graphName);
- continue;
+ HugeGraph retryOwner = null;
+ synchronized (this) {
+ HugeGraph owner = (HugeGraph) this.graphs.get(graphName);
+ if (owner != null || this.creatingGraphs.contains(graphName)) {
+ if (owner != null) {
+ // Independent key watches can deliver a replacement
ADD before the old REMOVE.
+ this.pendingGraphAdds.add(graphName);
Review Comment:
Confirmed: the local creation acknowledgement was being retained as a
replacement ADD. The handler now consumes the existing creation marker before
recording pending replacements when no failed peer owner needs cleanup, so a
healthy graph's own acknowledgement cannot republish it during reload. An
already retained failed peer owner keeps its existing cleanup retry priority,
including when that acknowledgement arrives late.
The regressions use the public graph create/reload entry points with real
GraphManager owners and native Gremlin bindings; PD metadata and event delivery
are controlled by the existing fixture. Both the self-ADD and no-ADD controls
now reload both graphs without stale pending state. A separate regression
verifies that a late self-ADD still retries the exact failed peer owner before
loading its replacement. Related graph/cache/task suites, formatting and the
full root compilation passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]