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

v10 #425

Merged
merged 90 commits into from
Aug 17, 2024
Merged

v10 #425

merged 90 commits into from
Aug 17, 2024

Conversation

timgit
Copy link
Owner

@timgit timgit commented Sep 10, 2023

No description provided.

Copy link

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

Great work! Only a few points.

src/index.js Outdated Show resolved Hide resolved
src/db.js Outdated Show resolved Hide resolved
src/db.js Show resolved Hide resolved
types.d.ts Outdated Show resolved Hide resolved
releasenotesv10.md Outdated Show resolved Hide resolved
@timgit timgit merged commit 4b3d9f4 into master Aug 17, 2024
3 of 4 checks passed
@timgit timgit deleted the v10 branch August 17, 2024 19:01
@janmeier
Copy link
Contributor

@timgit Can you put a couple of words on the motivation behind this major version? Which issues does this solve?

I'm saying this with the utmost understanding of what it means to release something as open source - This is your project, and I don't expect you to justify every decision. Still, I'm just curious about the reasoning, and I want to hear about any improvements that should cause us to consider upgrading :)

@timgit
Copy link
Owner Author

timgit commented Aug 29, 2024

The primary motivation is stability and scalability. In my and others' experience, once a single queue exceeded 1-2mil created jobs in a backlog state, postgres was unable to quickly locate the next record for locking via SKIP LOCKED. This is mentioned as a limitation in the linked article in the readme. This produced high memory and CPU utilization issues on the server, which would then impact all other databases. The problem with pg-boss v9's design is that once any queue reaches this failure state, all queues, including internal maintenance queues, were affected since all jobs shared a single table. The design goal was to mitigate a problematic queue by isolating its storage into a dedicated table via partitioning. This doesn't necessarily remove this limitation of SKIP LOCKED, but it should in theory be less of a catastrophic failure if and when it occurs in the future.

Over the years, there were several issues opened around queue concurrency, which added several functions and configuration which made the API more complicated and difficult to understand (sendSingleton() and others). There were several ideas that I wanted to prototype, which resulted in queue policies, the biggest feature enhancement worth upgrading for.

After a couple of failed attempts at building a reasonable migration plan into the new table structure, I decided it was best to release v10 without a schema migration. This wasn't my first choice, but I think it still was the cleanest way to make it predictable what to expect between these versions.

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.

8 participants