-
Notifications
You must be signed in to change notification settings - Fork 636
kvindexer/0.34/bugfixes in range queries and result deduplication #76
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
Conversation
…y ones existing; fixed tests
…ndermint into jasmina/kvindexer-fix-0.34
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Pushing a commit with the block indexing UTs I came up with... |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## v0.34.x #76 +/- ##
==========================================
Coverage ? 48.42%
==========================================
Files ? 280
Lines ? 49887
Branches ? 0
==========================================
Hits ? 24157
Misses ? 23875
Partials ? 1855 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ctx := context.Background() | ||
|
||
results, err := indexer.Search(ctx, query.MustParse("account.number >= 1")) | ||
assert.NoError(t, err) | ||
for _, tc := range testCases { |
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.
I refactored this to be able to add new TCs easily
heightRangeExists := false | ||
var heightCondition []query.Condition | ||
heightInfo.> | ||
heightInfo.> | ||
for _, c := range conditions { | ||
if c.CompositeKey == types.TxHeightKey { | ||
if c.Op == query.OpEqual { | ||
if heightRangeExists { | ||
if heightRangeExists || found { |
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.
Do we need to back/forward port this?
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.
IT has to be included in the open PR for 0.37. I have it in my todo for that PR. As well as porting the UTs you added to this PR.
Co-authored-by: Sergio Mena <sergio@informal.systems>
…… (backport cometbft#76) (cometbft#81) * perf(blockstore): Add LRU caches to blockstore operations used in consensus (backport cometbft#3003) (cometbft#3083) Closes cometbft#2844 We are seeing that the blockstore loading operations get used in hot loops within gossip routines, and queryMaj23 routines. This PR reduces that overhead using an LRU cache. The LRU cache does have a mutex on every get, but the time with the LRU cache is 9x faster than without (before even adding in DB overheads), due to the proto unmarshalling saved. We could imagine a setup where we avoided a lock there entirely. I don't think this is worth right now, since the new code is 9x faster, and these mostly appear in catchup code which should not be highly contended for across peers at the same time. With the new benchmark I added: OLD: ``` BenchmarkRepeatedLoadSeenCommit-12 24447 54691 ns/op 46495 B/op 319 allocs/op ``` NEW: ``` BenchmarkRepeatedLoadSeenCommit-12 224131 6401 ns/op 8320 B/op 2 allocs/op ``` It turns out these gossip routines don't need mutative copies, so we could optimize out the large allocation in the future if we want. 1 hour cpu profile that shows this appearing in prod:  The state machine execution time here for context is 92 seconds. So this is adding up in system load (and GC! The GC load is 52GB, the entire trace is 200GB, with other parts being optimized down from recent PRs) --- - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [ ] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#3003 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> (cherry picked from commit 0c10bd5) * Add Changelog (cherry picked from commit 4594f29) # Conflicts: # CHANGELOG.md --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Dev Ojha <dojha@berkeley.edu> Co-authored-by: PaddyMc <paddymchale@hotmail.com>
Original PR tendermint/tendermint#9884
This PR fixes two bugs when matching attributes within events:
CONTAINS
andEXISTS
would ignore the height requirement whenmatch.events = 1
.There have been minor improvements to the readability of the code:
heightInfo
struct that encapsulates all of that. Additionally, spuradious checks on whether the length of the conditions is a certain number has been replaced with simplebool
flags which are derived within thededupHeight
method.