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

fix(dynamodb): avoid unnecessary rejection given expired offsets #1295

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

pvlugter
Copy link
Contributor

Similar changes as #1293 for DynamoDB, but using TTL expiry.

While for R2DBC, we're managing the offset deletion, and basing this on the event timestamps, for DynamoDB it's just a simple TTL expiry set when the offset is written. So we use an accept before time that's just based on now minus the expiry.

When looking at this, noticed the expiry set on the separate latest-by-slice offsets. To keep things safer, have removed this expiry, so we always keep this for restarting a projection, while the per-pid offsets will be expired.

Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -155,10 +151,6 @@ import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse
}
attributes.put(Seen, AttributeValue.fromM(seen))

expiry.foreach { timestamp =>
attributes.put(Expiry, AttributeValue.fromN(timestamp.getEpochSecond.toString))
}
Copy link
Member

Choose a reason for hiding this comment

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

When looking at this, noticed the expiry set on the separate latest-by-slice offsets. To keep things safer, have removed this expiry, so we always keep this for restarting a projection, while the per-pid offsets will be expired.

Makes sense. It's the per-pid that will grow.

@patriknw patriknw merged commit c755fe1 into main Jan 14, 2025
22 checks passed
@patriknw patriknw deleted the dynamodb-timestamp-validation branch January 14, 2025 08:24
@patriknw patriknw added this to the 1.6.6 milestone Jan 14, 2025
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