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

Inconsistent ledger view in /accounts/{id} when streaming #2331

Closed
bartekn opened this issue Feb 26, 2020 · 1 comment · Fixed by #2344
Closed

Inconsistent ledger view in /accounts/{id} when streaming #2331

bartekn opened this issue Feb 26, 2020 · 1 comment · Fixed by #2344
Assignees
Labels
Milestone

Comments

@bartekn
Copy link
Contributor

bartekn commented Feb 26, 2020

I noticed Some extra balances error in /accounts/{id} stream. At first, I thought that it was the inconsistency issue propagated from stellar-core (we build Account object using a few DB queries without REPEATABLE READ transaction). But then I realized that we don't use REPEATABLE READ transaction in Horizon DB while streaming.

We should update the streaming code to start a REPEATABLE READ transaction (if not in a transaction already) before calling an action function and then rollback (only if not in a previously started transaction).

Additionally, we may do the same thing for a function getting data from core inside the action however we should first check if it affects core DB in any way.

@bartekn bartekn added this to the Horizon 1.1.0 milestone Feb 26, 2020
@bartekn
Copy link
Contributor Author

bartekn commented Feb 27, 2020

Additionally, we may do the same thing for a function getting data from core inside the action however we should first check if it affects core DB in any way.

We've seen another instance today for non-streaming request and the reason is getting data from core in multiple requests. So we should probably add start a new REPEATABLE READ transaction when getting data from Stellar-Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants