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

running multiple indexers simulatneously blocks the database #407

Open
karlicoss opened this issue Aug 25, 2023 · 0 comments
Open

running multiple indexers simulatneously blocks the database #407

karlicoss opened this issue Aug 25, 2023 · 0 comments
Labels
backend Related to indexing/serving

Comments

@karlicoss
Copy link
Owner

Basically the following scenario

  • you have an indexer that runs, say, for an hour
  • you have an indexer that runs for a minute

If you start the former first, it will get exclusive write lock (here, so the one that runs for minute will spend an hour waiting for it to be released before it can do anything.
As far as I understand, sqlite doesn't support multiple simultaneous writers, and even if it did need to think what should happen if both indexers update the same visits

Some options

  • only take the write lock to actually write the collected visits to the db. Currently it happens iteratively so we don't need to keep all the visits in the RAM
  • write to a temporary database first, and then merge with the main one?
@karlicoss karlicoss added the backend Related to indexing/serving label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to indexing/serving
Projects
None yet
Development

No branches or pull requests

1 participant