Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Definition edges an ordinary transaction commits don't reach the schema caches of other instances

Closed
#4,982 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

Start with ManagementSystem and ManagementLogger, then trace CACHED_TYPE_EVICTION handling for ordinary commits and schema-cache expiration in open transactions. Verify the reserved eviction id 0, sender and receiver behavior, rolling-version acknowledgement handling, and failure logging. Done means other instances stop serving stale definition edges without long-running transactions being force-closed.

Written by the indexing model from the issue text.

Description

  • Version: master (5c1b77ef8)
  • Storage Backend: any shared storage (BerkeleyJE, Cassandra, HBase, ...)
  • Mixed Index Backend: n/a
  • Expected Behavior: when an ordinary transaction on one JanusGraph instance commits definition edges, for example a connection or property constraint auto-created under schema.constraints=true or added with tx.addConnection(...) / tx.addProperties(...), the other instances stop serving the definitions they had cached.
  • Current Behavior: since #4953, such a commit expires the committing instance's own schema cache, and #4977 extends that to its open transactions. Nothing reaches the other instances, though. They keep the definition edges they cached (empty definition-edge lists are cached in both modes since #4953), and the first time one of them adds the same kind of edge, it creates another copy of the constraint.
Steps to Reproduce
  1. Open two instances on the same storage with schema.constraints=true and the default schema maker; create vertex label person and edge label knows through the management system.
  2. On instance B, read person's connections in a transaction (none yet; B caches the empty list).
  3. On instance A, add a person -knows-> person edge in an ordinary transaction and commit it (the connection is auto-created).
  4. Instance B still sees no connection, and adding a person -knows-> person edge there creates a second copy.
Design

ManagementSystem tells the other instances through a CACHED_TYPE_EVICTION message on the management log, but ManagementLogger.sendCacheEviction waits for every open instance to acknowledge it. An instance acknowledges only once all the transactions it had open have closed. With graph.management-auto-close-stale-instances, an instance that hasn't acknowledged within graph.management-ack-timeout (120 s) is force-closed. That is fine for deliberate management operations, but an ordinary write must not be able to get an instance with a long-running transaction force-closed.

So ordinary commits send the same message without registering an eviction trigger, under a reserved eviction id 0. The trigger counter hands out ids from 1, so no acknowledged eviction ever uses it.

  • A receiver expires the elements from its schema cache and its open transactions exactly as for a management eviction, but sends no acknowledgement for id 0.
  • Every instance which reads the message, the sender included, expires the elements from its schema cache and its open transactions; the sender re-reads what it expired when it sent the message.
  • Instances of earlier versions read the message format unchanged. They expire the elements and acknowledge id 0, and newer senders ignore that acknowledgement instead of logging "Could not find eviction trigger". A rolling upgrade therefore needs no preparation.
  • Failing to send the message is logged and doesn't fail the commit, which has already persisted everything.
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
20h 36m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JanusGraph/janusgraph

All issues in JanusGraph/janusgraph

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.