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


##########
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:
   070a9618: `addSchema()` and `updateSchema()` now read the generation before 
the storage write, and `updateCache()` runs under the `arrayCaches` lock and 
skips the update if a remote clear bumped the generation meanwhile. Same guard 
as the read paths. New test `testV2LocalWriteIsNotCachedAcrossRemoteClear`.
   
   On impact: with the reconciler on, the stale entry did not stay forever. The 
writer's own version write after `updateCache()` differs from the version its 
reconciler adopted at the clear, so a later tick cleared it again. With 
`reconcile_interval=0` it could stay, and either way it was a wrong read, so 
the guard is needed.
   



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