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

Add ability to customize task repository #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcellustavares
Copy link

@marcellustavares marcellustavares commented Apr 30, 2020

hey @kagkarlsson, thanks for the project!

I was wondering what you think about adding the ability to customize task repositories so we can switch to non-JDBC compliant stores.

Cheers

@kagkarlsson
Copy link
Owner

Sorry, missed replying to this one.

I think that might be possible, but that task repository would need to provide the same guarantees as the jdbc one. We are currently using the version field for optimistic locking, for example to ensure that only a single scheduler will be able to "lock" an execution. But it should be possible to implement similar guarantees in other stores..

@kagkarlsson
Copy link
Owner

What store did you have in mind?

@marcellustavares
Copy link
Author

yea, i thought about elasticsearch initially.

@kagkarlsson
Copy link
Owner

I think this might be doable. The TaskRepository would have to be a bit formalized and come with a contract that needs to be fulfilled to work properly with the Scheduler. The contract would be tested by a suite of integrationtests run against a testcontainer-instance of the data store in question.

@rafal-kowalski
Copy link
Contributor

Hi, I would really like to have similar feature. I need to override JdbcTaskRepository.getDue and explicitly add limit to sql statement, due to how Postgres planner works internally, now if there is a lot of due tasks (millions) it uses sequential scan instead of index, because query is suppose to return all of the rows. With explicit limit in that case it will use index because it knows that we need only a small subset.
I could make a PR, but I guess I need some input from you how to approach TaskRepository contract. Do you have some idea in mind?

@kagkarlsson
Copy link
Owner

Hi, I would really like to have similar feature. I need to override JdbcTaskRepository.getDue and explicitly add limit to sql statement, due to how Postgres planner works internally, now if there is a lot of due tasks (millions) it uses sequential scan instead of index, because query is suppose to return all of the rows. With explicit limit in that case it will use index because it knows that we need only a small subset.
I could make a PR, but I guess I need some input from you how to approach TaskRepository contract. Do you have some idea in mind?

Hi! This is a bit of a different use-case, would you please raise this in a separate issue? 😄

@kagkarlsson
Copy link
Owner

kagkarlsson commented Jan 12, 2021

No description provided.

@kagkarlsson
Copy link
Owner

Added an issue to track this feature, #173

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

3 participants