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

Remove Temporary Logging of Duplicates to Sentry. #53

Merged

Conversation

yuenmichelle1
Copy link
Collaborator

Because ERAS is one of the ONLY receiving apps that receives from kinesis and BULK UPSERTS (feature of Rails 6+), it has caught duplicates on payload from kinesis stream
See: https://zooniverse-27.sentry.io/issues/4717869260/?project=4506117954011141&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=14d&stream_index=3

EVEN THOUGH de-duping the payload by id before upserting should resolve issues with ERAS, (since ERAS only cares about counting the classification/comment once),

Since ERAS is one of the only places we can catch this error (because of how it can bulk upsert), the team has decided to log the error to Sentry when the duplicates in payload occurs and also log the payload to Sentry.

Should note that this duplicate error has been seen before:
SEE: zooniverse/zoo-stats-api-graphql#128

ALSO NOTING: THIS CATCH, LOG, DEDUPE AND TRY UPSERTING AGAIN TO DB SITUATION WAS TEMPORARY AND ONLY USED TO SEE WHAT THE DUPES IN THE KINESIS PAYLOAD ARE.

ONE MORE NOTE: per Kinesis docs, it is VERY possible for Kinesis stream to send duplicates and the recommendation of AWS is to appropriately handle process records.
SEE: https://docs.aws.amazon.com/streams/latest/dev/kinesis-record-processor-duplicates.html

… since eras was the only app that receives from kinesis and bulk upserts
@yuenmichelle1 yuenmichelle1 merged commit 580eb54 into main Feb 27, 2024
4 checks passed
@yuenmichelle1 yuenmichelle1 deleted the remove-tenmporary-logging-of-duplicates-and-deduplicate branch May 22, 2024 19:08
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.

1 participant