perf(l1): use secondary instances for reading in RocksDB #4657
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP: we want to see if using secondary instances improves read performance, and maybe later on compaction.
The initial approach is to make it just work to see possible issues, understand how it works, etc, so it tries to catch up at every write step and keeps both instances inside a single Engine instance.
We'll probably want to handle it different before considering the feature ready.
First, we might want to split it so we can make multiple secondary instances, and be more flexible about catch-up frequency.
For example, the RPC probably can live slightly out of date, while block production tends to need the latest version and the primary instance might be better for all operations there. The P2P handler is likely to need both so it can respond to requests from the secondary while having access to the primary for when it receives responses to its own queries.