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

Lock queried rows for each block transaction #1409

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

stwiname
Copy link
Collaborator

Description

Puts a lock on each query made by handlers in each block.

⚠️ This is untested ⚠️
Things to test:

  • It adds the concurrency guarantee we want
  • Because we have a transaction for each block, if there are multiple handlers run for the same block that accesses the same value can they still update a single entity multiple times

Motivation

With multichain indexing we need some more concurrency guarantees. We want to prevent the following example from happening.

Chain A reads entity X and then updates it to a new value. Between reading X and updating it chain B updates X.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch

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.

1 participant