Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Recovery based on only the last event #651

Merged
merged 4 commits into from
Jan 28, 2025
Merged

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Jan 24, 2025

Implementation of akka/akka#32629

  • bump: Akka core 2.10.1

@@ -137,23 +138,44 @@ private[r2dbc] class PostgresQueryDao(executorProvider: R2dbcExecutorProvider) e
protected def selectOneEventSql(slice: Int): String =
sqlCache.get(slice, "selectOneEventSql") {
sql"""
SELECT slice, entity_type, db_timestamp, $sqlDbTimestamp AS read_db_timestamp, event_ser_id, event_ser_manifest, event_payload, meta_ser_id, meta_ser_manifest, meta_payload, tags
SELECT entity_type, db_timestamp, $sqlDbTimestamp AS read_db_timestamp, event_ser_id, event_ser_manifest, event_payload, meta_ser_id, meta_ser_manifest, meta_payload, tags
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removal of the slice column in some selects is an unrelated cleanup. retrieve of slice is unnecessary since we already have the slice.

.map(_.map(row => deserializeSnapshotRow(row, serialization)))
def loadAsync(persistenceId: String, criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = {
if (criteria.maxSequenceNr <= 0)
FutureNone
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optimization, it would otherwise query the db also for disabled snapshot criteria

@patriknw patriknw requested a review from aludwiko January 24, 2025 09:55
Copy link
Contributor

@aludwiko aludwiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as soon as Akka bump is final 2.10.1 release

@patriknw patriknw added this to the 1.3.2 milestone Jan 28, 2025
@patriknw patriknw force-pushed the wip-recover-last-patriknw branch from d1a01e2 to fb42e10 Compare January 28, 2025 12:36
@patriknw patriknw merged commit f77906c into main Jan 28, 2025
9 of 10 checks passed
@patriknw patriknw deleted the wip-recover-last-patriknw branch January 28, 2025 13:10
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.

3 participants