commitment/backtester: fix issues preventing para trie runs #18600
+167
−64
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.
This PR fixes issues related to running the commitment backtester with the para trie v0 implementation (parallel only across the top row 16 nibbles)
The main issue that was fixed is a panic that occurred when using the same temporal read-only tx in different goroutines with API calls that involve a Cursor such as for GetAsOf (stack trace can be seen below). This was fixed by using a separate read-only transaction per goroutine in the para trie which was something I was planning on doing anyway.
Other minor fix included is that the para trie was not writing csv metrics files when enabled.
Now with this PR we are able to run the para trie in the backtester successfully using the
--para-trieflag. In future PR I will add support for also running with pre-warmup with a--pre-warmupflag and additionally a cmd that will allow us to compare results between several backtest runs so that we can compare (sequential vs sequential-with-pre-warmup vs para-trie-v0 vs para-trie-v0-with-prewarmup).