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: sort toggleNames before updating last seen #4747

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

andreas-unleash
Copy link
Contributor

@andreas-unleash andreas-unleash commented Sep 15, 2023

Seems like when 2 pods are trying to POST lastSeen metrics, the db gets into a deadlock state.

This is an attempt to fix the deadlock by sorting the toggleNames before the update.

The hypothesis is that sorted toggle names will reduce the chance of working on the same row at the same exact time

Closes # 1-1382

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
@vercel
Copy link

vercel bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2023 9:30am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Sep 15, 2023 9:30am

Copy link
Contributor

@sjaanus sjaanus left a comment

Choose a reason for hiding this comment

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

Looks good, but I guess this is just theory. Also we need to release hotfix for 5.4.

@andreas-unleash andreas-unleash merged commit 76a834c into main Sep 15, 2023
11 checks passed
@andreas-unleash andreas-unleash deleted the fix/sort_features_before_setLastSeen branch September 15, 2023 10:02
andreas-unleash added a commit that referenced this pull request Sep 15, 2023
Seems like when 2 pods are trying to POST lastSeen metrics, the db gets
into a deadlock state.

This is an attempt to fix the deadlock by sorting the toggleNames before
the update.

The hypothesis is that sorted toggle names will reduce the chance of
working on the same row at the same exact time

Closes #
[1-1382](https://linear.app/unleash/issue/1-1382/order-data-before-updating-the-lastseen-to-reduce-change-of-deadlock)

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
(cherry picked from commit 76a834c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants