You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/10 09:54:24 UTC

[PR] feat: support TimestampOffset in PersistenceTestKitReadJournal tag and slice queries [pekko]

pjfanning opened a new pull request, #3615:
URL: https://github.com/apache/pekko/pull/3615

   Fixes #1765
   
   ## What changed
   
   `PersistenceTestKitReadJournal.eventsByTag`, `currentEventsByTag`, `eventsBySlices` and `currentEventsBySlices` threw `UnsupportedOperationException("Offsets not supported for persistence test kit ...")` for any offset except `NoOffset`.
   
   - These four queries now accept a `TimestampOffset` and return only the events after it. The offset is exclusive, so the offset from an envelope can be passed back in to resume.
   - Any other offset type fails eagerly with `IllegalArgumentException`, via `TimestampOffset.toTimestampOffset`.
   - The tag queries and the live `eventsBySlices` query now put a `TimestampOffset` in their envelopes. Before, they used `Sequence(sequenceNr)`, which is per persistence id and can't be used to resume a cross-entity query. `currentEventsBySlices` and `currentEventsByPersistenceIdTyped` already used `TimestampOffset`. The shared logic lives in a new internal `TimestampOffsets` helper.
   
   This works because the testkit journal gives every atomic write a strictly increasing timestamp, and each atomic write holds a single persistence id. So `(timestamp, persistenceId, seqNr)` fully orders the events.
   
   ## Behaviour change
   
   Tag-query and live slice-query envelopes now carry `TimestampOffset` instead of `Sequence`. Code that cast these offsets to `Sequence` needs updating. The old value was the per-persistence-id sequence number, which was already available as `envelope.sequenceNr`.
   
   ## Tests
   
   Added tests for resuming from an offset and for rejecting unsupported offset types to `CurrentEventsByTagSpec`, `CurrentEventsBySlicesSpec`, `EventsByTagSpec` and `EventsBySliceSpec`. `persistence-testkit/testOnly org.apache.pekko.persistence.testkit.query.*` passes (34 tests). MiMa is disabled for `persistence-testkit`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: support TimestampOffset in PersistenceTestKitReadJournal tag and slice queries [pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #3615:
URL: https://github.com/apache/pekko/pull/3615#issuecomment-6106013005

   better squash to one commit


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] feat: support TimestampOffset in PersistenceTestKitReadJournal tag and slice queries [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #3615:
URL: https://github.com/apache/pekko/pull/3615


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org