haohao0103 opened a new issue, #2728: URL: https://github.com/apache/incubator-hugegraph/issues/2728
### Bug Type (问题类型) logic (逻辑设计问题) ### Before submit - [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents) ### Environment (环境信息) - Server Version: 1.5.0 (Apache Release Version) ### Expected & Actual behavior (期望与实际表现) If we enable the RPC server and RPC client configurations in the rest-server.properties configuration file, intending to implement RPC communication among multiple Graph Servers to maintain cache data consistency, the current code logic does not support this functionality. Existing Cache Notifier Mechanism: In StandardHugegraph#registerRpcServices(), the HugeGraphCacheNotifier is registered as a service. During the construction of HugeGraphCacheNotifier, a cacheEventListener listening for Events.CACHE type events is added to the graphEventHub. This cacheEventListener specifically listens for actions of type Cache.ACTION_INVALIDATED. In CachedGraphTransaction#listenChanges, another cacheEventListener is defined, which listens for Cache.ACTION_INVALID type events. However, when attempting to add this cacheEventListener to the graphEventHub, the current code logic checks whether there is already a listener for Events.CACHE type events in the graphEventHub. If one exists, it skips adding the new listener. As a result, the listener that should respond to Cache.ACTION_INVALID events is never added to the graphEventHub, causing the entire notifier mechanism to malfunction. Proposed Fix: 1. Modify the logic to allow the cacheEventListener in CachedGraphTransaction to listen for Events.CACHE events and handle Cache.ACTION_INVALID actions. 2. Ensure that the cacheEventListener functions correctly in multi-graph scenarios. ### Vertex/Edge example (问题点 / 边数据举例) ```javascript ``` ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构) ```javascript ``` -- 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]
