Skip to content

[EXPERIMENT] Emit all messages across sequence number gaps in messagesWithBatch (1.3.x branch)#518

Closed
pjfanning wants to merge 3 commits into
apache:1.3.xfrom
pjfanning:journal-delete-1.3
Closed

[EXPERIMENT] Emit all messages across sequence number gaps in messagesWithBatch (1.3.x branch)#518
pjfanning wants to merge 3 commits into
apache:1.3.xfrom
pjfanning:journal-delete-1.3

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Copies over #517 to see if it works ok in this branch.
Just an experiment at the moment.

mucciolo added 3 commits June 8, 2026 00:18
…ache#516

* The query windowing introduced by apache#180 treated a windowed batch returning
  fewer messages than batchSize as the end of the journal: bounded streams
  (recovery, currentEventsByPersistenceId) completed early and silently
  dropped every message beyond a gap left by deleted messages, and live
  streams stalled forever polling an empty window. apache#195 fixed only the gap
  at the head of the journal.
* Rework the unfoldAsync state from FlowControl into a QueryPlan state
  machine (QueryRemaining, QueryWindow, PollRemaining, Complete): a short
  windowed batch is no longer conclusive and falls back to one query over
  the full remaining range, which gaps cannot hide messages from.
* Keep windowing as the dense fast path of apache#180: after a full batch shows
  the journal to be dense, queries stay bounded to [from, from + batchSize].
* Span the full remaining range on the first query, crossing a deleted
  journal head (snapshot cleanup) in a single round trip, subsuming the
  apache#195 special case.
* Poll the full remaining range when tailing: a windowed poll can never
  reach messages appended beyond a trailing gap.
* Specify the gap state machine in MessagesWithBatchTest (core, in-memory
  journal stub) and the database-coupled behavior in
  MessagesWithBatchDatabaseContractTest (H2 plus the five integration
  databases): hard and soft deletes, a prefix purge through the journal's
  delete, and serialization failures.
Oracle treats the empty string as NULL, so inserting the synthetic
corrupt row with writer = "" violated the NOT NULL constraint on
EVENT_JOURNAL.WRITER (ORA-01400) and failed only the Oracle integration
tests. The production write path always carries a writer UUID, so this is
a test-fixture-only fix.
These files contain no Akka-derived code, so they should carry the full
ASF header (the headerLicense the build stamps on new files) rather than
the shorter "derived from Akka" variant, per a maintainer review note.
@pjfanning pjfanning marked this pull request as draft June 7, 2026 23:29
@pjfanning pjfanning closed this Jun 13, 2026
@pjfanning pjfanning deleted the journal-delete-1.3 branch June 13, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants