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 lock strategy #42

Merged
merged 3 commits into from
May 19, 2024
Merged

Fix lock strategy #42

merged 3 commits into from
May 19, 2024

Conversation

juliangruber
Copy link
Member

Process ids maybe be reused, UUIDs provider strong uniqueness guarantees.

Process ids maybe be reused, UUIDs provider strong uniqueness guarantees.
@juliangruber juliangruber requested a review from bajtos May 10, 2024 13:23
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Looks mostly good, see one suggestion below.

Have you considered the migration path?

  • What if there are some locked rows left over from the previous deployment, will your migration script handle that?
  • Is there anything else to consider?

voyager-publish/test/unit.test.js Outdated Show resolved Hide resolved
@bajtos
Copy link
Member

bajtos commented May 10, 2024

Have you considered the migration path?

Do you have an idea how long it will take PG to rework those two columns for all the rows in the table now? I don't know how many there are. If there are fewer than 100k, we should be fine. If there are more than 100m, we are definitely in trouble.

@juliangruber
Copy link
Member Author

What if there are some locked rows left over from the previous deployment, will your migration script handle that?

Numbers can be converted to Strings, this should be fine.

Do you have an idea how long it will take PG to rework those two columns for all the rows in the table now? I don't know how many there are. If there are fewer than 100k, we should be fine. If there are more than 100m, we are definitely in trouble.

I don't really see an alternative. We can delay publishing this as the queue is still being processed.

postgres=# select count(*) from measurements where locked_by_pid is not null;
  count
---------
 1100000

@juliangruber juliangruber merged commit 35b6c46 into main May 19, 2024
8 checks passed
@juliangruber juliangruber deleted the fix/lock-strategy branch May 19, 2024 13:36
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.

None yet

2 participants