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

feat: redis transaction for all storage updates in block #79

Merged
merged 1 commit into from Sep 22, 2022

Conversation

jmhrpr
Copy link
Member

@jmhrpr jmhrpr commented Sep 3, 2022

The comment suggests you planned to add this, and indeed it makes sense. This executes all the commands needed to process a particular block at once which means we can't query data as it is still being updated. This prevents, for example, race conditions when reading data while updating balances per transaction input/output.

The redis crate support for transactions does not seem suitable for our needs and also does not provide methods for the MULTI and EXEC commands required to perform a transaction, for this reason we manually create the commands. MULTI starts the transaction, and all commands that follow it are queued until a EXEC command is sent.

Is there any issues here where something might happen to prevent the EXEC to end the transaction being called?

Copy link
Member

@rvcas rvcas left a comment

Choose a reason for hiding this comment

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

nice

@scarmuega scarmuega merged commit eaf87ab into txpipe:main Sep 22, 2022
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