Re: JanusGraph database cache on distributed setup

Boxuan Li

Thanks Marc for making it clear.

@Wasantha, how did you implement your void invalidate(StaticBuffer key, List<CachableStaticBuffer> entries) method? Make sure you evict this key from your Redis cache. The default implementation in JanusGraph does not evict it immediately. Rather, it records this key in a local HashMap called expiredKeys and evicts the entry after a timeout. If you use this approach, and you don’t store expiredKeys on Redis, then your other instance could still read stale data. I personally think the usage of expiredKeys is not necessary in your case - you could simply evict the entry from Redis in the invalidate call.

If you still have a problem, probably a better way is to share your code so that we could take a look at your implementation.


On Feb 20, 2022, at 6:23 AM, hadoopmarc@... wrote:

If you do not use sessions, remote requests to Gremlin Server are committed automatically, see: .

Are you sure that committing a modification is sufficient to move over the change from the transaction cache to the database cache, botth in the current and in your new ReDis implementation? Maybe you can test by having a remote modification test followed by a retrieval request of the same vertex from the same client, so that the database cache is filled explicitly (before the second client attempts to retrieve it).


Join to automatically receive all group messages.