fix: stop persisting CDC processor read marker across restarts - #20
Merged
pallakartheekreddy merged 1 commit intoAug 17, 2026
Conversation
setProcessorIdentifier("janusgraph-cdc-processor") makes JanusGraph persist
a durable read marker and resume from it on every subsequent restart,
silently ignoring setStartTime() after the very first run.
This means every JanusGraph stop/start replays old/backlogged
transaction-log entries. Vertex property lookups on those replayed
entries come back empty (a JanusGraph/storage limitation on log-replay
transaction handles), so SunbirdLegacyMessageConverter falls back to
objectType="vertex" for every backlogged event and filters it out via
the "no IL_FUNC_OBJECT_TYPE set" check. Net effect: CDC silently stops
emitting any events after a restart, until the backlog fully drains.
Removing the processor identifier means the log processor never persists
a marker, so it always starts fresh from setStartTime() (now - 1 minute)
on every restart — trading replay of the outage window for CDC actually
working after a restart, which is the correct tradeoff for a live
content-indexing pipeline.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesCDC restart behavior
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pallakartheekreddy
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GraphLogProcessor.init()registers the transaction-log processor withsetProcessorIdentifier("janusgraph-cdc-processor"). An identified log processor persists its read marker in JanusGraph and resumes from it on every subsequent restart — silently ignoringsetStartTime()after the very first run.Root cause
Every JanusGraph stop/start replays old/backlogged transaction-log entries because of the persisted marker. Vertex property lookups (e.g.
IL_FUNC_OBJECT_TYPE) performed on vertex handles bound to a replayed historical transaction come back empty — this appears to be a JanusGraph/storage-backend limitation when reading properties outside the specific transaction's own change-set.SunbirdLegacyMessageConverterfalls back tovertex.label()(JanusGraph's generic"vertex"label) when that lookup is empty, which then hits the existing filter:Net effect: after any JanusGraph restart, every backlogged event is filtered out, and CDC silently stops producing anything until the backlog fully drains (which itself takes a long time and can appear to "never recover" on clusters with a large accumulated transaction-log history, e.g. after a disaster-recovery restore).
Reproduced and confirmed via debug logging on a live cluster: the marker loaded on restart showed
Loaded identified ReadMarker start time <stale timestamp>instead ofnow, and every processed message hitEvent filtered by converter for node <id>— 100% filter rate, including on messages only minutes old (i.e. not a formatting/legacy-data issue, purely a replay-vs-live distinction).Fix
Remove
.setProcessorIdentifier(...). Without an identifier, the log processor never persists a marker, so it always starts fresh fromsetStartTime()(now - 1 minute) on every restart. This trades replaying the exact outage window for CDC actually continuing to work after a restart — the correct tradeoff for a live content-indexing pipeline where a live/current pipeline matters more than a complete historical replay.Test plan
janusgraph-cdc-processorin the backend after this changeSummary by CodeRabbit