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/25 00:04:09 UTC
[PR] grpc: populate offset seen from the event when it is omitted [pekko-projection]
pjfanning opened a new pull request, #660:
URL: https://github.com/apache/pekko-projection/pull/660
### Motivation
The `seen` entries of the protocol `Offset` are redundant when they only contain the persistence id and sequence number of the enclosing `Event` or `FilteredEvent`. akka/akka-projection#999 made the consumer tolerate an empty `seen` so that producers can omit it.
### Modification
- When converting an `Event` or `FilteredEvent` to an `EventEnvelope`, the gRPC consumer fills in `seen` with `persistenceId -> seqNr` of the enclosing event if the protocol offset has no `seen` entries.
- The conversion moved into an internal helper on the `GrpcReadJournal` companion so it can be tested directly. Akka has this logic in `ProtobufProtocolConversions`, which Pekko doesn't have yet (it arrives with producer push, akka/akka-projection#932).
- The `event_producer.proto` comment documents that `seen` is optional.
### Result
Consumers handle offsets without `seen` correctly.
Rolling upgrades: producers still send `seen`, so this is receiver-side tolerance only. The wire format is unchanged.
### Tests
- `sbt "grpc-test/Test/testOnly org.apache.pekko.projection.grpc.consumer.scaladsl.GrpcReadJournalOffsetSpec"`: the empty-`seen` case failed before the fix and passes after; the case with `seen` present passes both before and after.
- `grpc/mimaReportBinaryIssues`: not applicable, MiMa is disabled for the `grpc` module (new in 2.0.0).
- Native scalafmt on changed Scala files, `sbt headerCreateAll`, whitespace diff check: clean.
### References
Refs akka/akka-projection#999 (https://github.com/akka/akka-projection/pull/999) - source of the ported code. The Akka 1.5.0 change date (2026-10-25) has passed. Upstream had no test; the test here is new.
--
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