Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

CI-for-pr-667 #668

Draft
wants to merge 11 commits into
base: release/v0.15
Choose a base branch
from
Draft

CI-for-pr-667 #668

wants to merge 11 commits into from

Conversation

shwethaumashanker
Copy link
Contributor

Also do not log all duplicated emails, can be many

What changed?

Why?

How did you test it?

Potential risks

Is patch release candidate?

Link to relevant docs PRs

A simple helper to automatically run paginated queries with ddb
This is useful to troubleshoot the internal DB state.

Uses paginated queries
Due a bug in the sync process, that does not consume paginated
results from dynamodb, we are getting duplicated users
in dynamodb.

This command searches all duplicated users based on email, keeping
only the first one (most recent CreatedAt). It reports
back the duplicated users and allow to delete them in dynamodb.

Supports options to limit the users to list, dryrun mode,
maximum duplicates to delete, etc.
We must only pass the unique keys to the deletion task, or
dynamodb complains by duplicates (even on a delete!)
To speed up the deletion of >600k entries
We might have 1000s of users, and the ddb.Query() will return
a paginated response.

We must read all of the pages in order to work. Otherwise, the
sync process will consider that the users retuned by the IDP
do not exist, and create new entries in each iteration.
detect and report duplicated users when syncing, returning
the oldest.

This is important if there are duplicates in DB to be sure
we use the oldest and provide a consistent state.

Logging is Good to find out about the existence of the bug
Also do not log all duplicated emails, can be many
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants