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

Refactor badger storage dependency parsing for better performance #1694

Closed
wants to merge 11 commits into from

Conversation

burmanm
Copy link
Contributor

@burmanm burmanm commented Jul 26, 2019

Which problem is this PR solving?

Currently getting the dependencies window can take a lot of time if there are significant amount of active spans in the badger.

With 1.6 million active spans this took 10 seconds to return on my machine. After this patch, it takes 1.1s on my machine.

Short description of the changes

  • Adds new index for dependency writing (one extra write - but inside same transaction)
  • Does not decode the protobufs or touch the values in badger and instead uses key only parsing to find these results.
  • Does not store a lot of stuff in the memory, instead it parses them while getting them from badger
  • Adds new key to the storage which indicates the used version
  • Adds schema migration from version 0 to version 1

@burmanm burmanm force-pushed the badger_dependency branch from a11080b to 688bc40 Compare July 26, 2019 21:02
@burmanm burmanm marked this pull request as ready for review July 29, 2019 14:17
@burmanm burmanm force-pushed the badger_dependency branch from db1fcc2 to 4a9839c Compare July 31, 2019 08:31
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #1694 into master will decrease coverage by 0.1%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1694      +/-   ##
==========================================
- Coverage   98.36%   98.26%   -0.11%     
==========================================
  Files         193      194       +1     
  Lines        9364     9495     +131     
==========================================
+ Hits         9211     9330     +119     
- Misses        119      125       +6     
- Partials       34       40       +6
Impacted Files Coverage Δ
plugin/storage/badger/spanstore/writer.go 97.59% <100%> (+0.36%) ⬆️
plugin/storage/badger/dependencystore/storage.go 87.5% <100%> (-7.24%) ⬇️
plugin/storage/badger/spanstore/reader.go 96.89% <100%> (+0.25%) ⬆️
plugin/storage/badger/factory.go 98.14% <100%> (+0.05%) ⬆️
plugin/storage/badger/spanstore/schema_manager.go 86.58% <86.58%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2724a58...88aeff0. Read the comment docs.

@burmanm
Copy link
Contributor Author

burmanm commented Aug 5, 2019

Seems Travis is failing to github timeouts today..

@jpkrohling
Copy link
Contributor

This latest failure is actually a real one:

Go fmt, license check, or import ordering failures, run 'make fmt'

@burmanm
Copy link
Contributor Author

burmanm commented Aug 5, 2019

make fmt gives me nothing related to this PR:

[michael@nina jaeger]$ git status -s
 M examples/hotrod/services/frontend/gen_assets.go
 M jaeger-ui
[michael@nina jaeger]$ make fmt
./scripts/import-order-cleanup.sh inplace
Running go fmt...
./scripts/updateLicenses.sh
[michael@nina jaeger]$ git status -s
 M examples/hotrod/services/frontend/gen_assets.go
 M jaeger-ui
[michael@nina jaeger]

Nor make test-ci ?

@burmanm burmanm force-pushed the badger_dependency branch from 2df603e to 239c5da Compare August 5, 2019 17:16
@burmanm
Copy link
Contributor Author

burmanm commented Aug 5, 2019

Lets see if rebase fixes Travis

burmanm added 2 commits August 8, 2019 17:22
Signed-off-by: Michael Burman <[email protected]>
Signed-off-by: Michael Burman <[email protected]>
@burmanm
Copy link
Contributor Author

burmanm commented Aug 9, 2019

codecov never ceases to amaze me. I'm getting coverage diff rejection because of change in processor.go. Yet, this PR doesn't even have that file.

@yurishkuro
Copy link
Member

@pavolloffay pavolloffay added the storage/badger Issues related to badger storage label Aug 14, 2019
@jpkrohling
Copy link
Contributor

Closing due to inactivity.

@jpkrohling jpkrohling closed this Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
storage/badger Issues related to badger storage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants