-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[R4R]txindex/kv: Fsync data to disk immediately after receiving it #4104
Conversation
This comment has been minimized.
This comment has been minimized.
CHANGELOG_PENDING.md
Outdated
@@ -30,3 +30,4 @@ program](https://hackerone.com/tendermint). | |||
### BUG FIXES: | |||
|
|||
- [tools] [\#4023](https://github.com/tendermint/tendermint/issues/4023) Refresh `tm-monitor` health when validator count is updated (@erikgrinaker) | |||
- [index] [\#4104](https://github.com/tendermint/tendermint/pull/4104) Fix tx index lag too much |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [index] [\#4104](https://github.com/tendermint/tendermint/pull/4104) Fix tx index lag too much | |
- [state] [\#4104](https://github.com/tendermint/tendermint/pull/4104) txindex/kv: Fsync data to disk immediately after receiving it (@guagualvcha) |
BEFORE:
AFTER:
Performance drop is pretty steep, but I think it's the right thing to do UNTIL we have a WAL. |
@melekes what is that benchmark on ? Individual Regardless this is an important fix - thanks @guagualvcha . Seems also independent from #3211 which we'll need to address as well. |
AddBatch calls tendermint/state/txindex/kv/kv_test.go Lines 314 to 353 in 97222eb
|
Hmm. Is the first number in |
Yes |
Why this pr:
When restarting chain node, sometimes we lost tx index about recent(around 80)blocks, and some client complains that they can't find the tx by RPC call(tx_search) when the tx do exist in the block.
I try to partially fix this issue in a simple way by writing the index data in a sync way.
There is no performance difference under 1K TPS according to our test.
It is still possible that lost index data after restarting the node, but only 2 block data will lost at most.
I try to totally fix this in https://github.com/tendermint/tendermint/pull/3847/files, but this one is simple and can solve most part of the issue. Please review first, thks.