contrueCT opened a new pull request, #3469:
URL: https://github.com/apache/hugegraph/pull/3469

   ## Purpose of the PR
   
   - close #3467
   
   A transient empty edge read could be stored in `CachedGraphTransaction` as a 
negative cache entry. Later REST `kout` and Gremlin neighbor requests for the 
same query key then returned empty until cache expiry or graph restart, even 
when the backend read had recovered.
   
   ## Main Changes
   
   Empty edge batches are no longer added to `edgesCache`. Positive edge 
batches keep the existing cache behavior, expiry checks, mutation invalidation, 
query limits, and HStore routing.
   
   ```mermaid
   sequenceDiagram
       participant Q as Neighbor query
       participant C as Edge cache
       participant S as Backend/HStore
       Q->>C: lookup query key
       C-->>Q: miss
       Q->>S: read edges
       S-->>Q: transient empty batch
       Q->>C: do not store empty result
       Q->>S: later read
       S-->>Q: edge batch
       Q->>C: store positive batch
   ```
   
   REST `kout` and Gremlin vertex steps share the graph edge-query path, so one 
cache policy covers both surfaces. The underlying HStore/PD event that might 
produce the first transient empty read is outside this patch and remains 
separately observable.
   
   ## Verifying these changes
   
   - [x] Need tests and can be verified as follows:
     - `CachedGraphTransactionTest`: 32 tests passed.
     - `ConcurrentVerticesConsumerTest`: 7 tests passed.
     - `GraphTransactionTest`: 9 tests passed.
     - The regression test forces the first backend read empty, restores the 
real backend, and verifies that the second read returns the persisted edge.
     - Empty edge batches are verified to be queried again instead of being 
reused from cache.
   
   The historical HStore/PD routing trigger was not reproduced. The test proves 
the stale-negative-cache mechanism independently of that trigger.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ] Dependencies
   - [ ] Modify configurations
   - [ ] The public API
   - [ ] Other affects
   - [x] Nope
   
   ## Documentation Status
   
   - [x] `Doc - No Need`
   


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