Copilot commented on code in PR #3237:
URL: https://github.com/apache/hugegraph/pull/3237#discussion_r4097975530


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CachedSchemaTransactionV2.java:
##########
@@ -318,8 +400,10 @@ protected void updateSchema(SchemaElement schema,
         super.updateSchema(schema, updateCallback);
 
         this.updateCache(schema);
-        // Status transitions are internal bookkeeping; notifying here causes a
-        // broadcast storm for every updateSchemaStatus() call from background 
jobs.
+        // No meta event here: one per updateSchemaStatus() call from 
background
+        // jobs would be a broadcast storm. The schema version has no fan-out,
+        // other servers check it at most once per reconcile interval.
+        this.bumpSchemaVersion();

Review Comment:
   The new lock/generation guard does not cover the `updateCache(schema)` call 
immediately above: a local update can finish its storage write, be paused, then 
a remote version tick can clear the shared caches before this method inserts 
the older local object. That stale object is then reintroduced after the remote 
clear and can remain cached indefinitely. Capture the generation around the 
schema write and only update the caches while holding `arrayCaches` when it is 
unchanged (or otherwise make this writer participate in the same guard).



-- 
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]

Reply via email to