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

Boltdb shipper query readiness #2911

Merged

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:

  1. Queriers would open and reuse the existing index file in cache dir during startup.
  2. Adds support for being query ready for configured last n days by keeping the index always downloaded for that duration.

Special notes for your reviewer:

  1. Query readiness only considers daily tables for simplicity, we already have made it mandatory to have daily tables for boltdb-shipper, long back.
  2. I have removed the code for checking the mtime of already downloaded files during sync operation because we never upload a file with the same name but with different content. This is done to simplify the code for Sync operation.

Checklist

  • Documentation added
  • Tests updated

@slim-bean slim-bean self-assigned this Nov 17, 2020
@slim-bean slim-bean added this to the 2.1 milestone Nov 17, 2020
@slim-bean slim-bean assigned cyriltovena and unassigned slim-bean Nov 17, 2020
@sandeepsukhani sandeepsukhani force-pushed the boltdb-shipper-query-readiness branch from 289c1cc to 0e007a5 Compare November 17, 2020 13:42
@codecov-io
Copy link

codecov-io commented Nov 17, 2020

Codecov Report

Merging #2911 (4cfe998) into master (1c8dd3e) will increase coverage by 0.03%.
The diff coverage is 57.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2911      +/-   ##
==========================================
+ Coverage   61.77%   61.81%   +0.03%     
==========================================
  Files         182      182              
  Lines       14772    14863      +91     
==========================================
+ Hits         9126     9187      +61     
- Misses       4811     4830      +19     
- Partials      835      846      +11     
Impacted Files Coverage Δ
pkg/storage/stores/shipper/shipper_index_client.go 0.00% <0.00%> (ø)
.../storage/stores/shipper/downloads/table_manager.go 56.77% <50.00%> (-3.67%) ⬇️
pkg/storage/stores/shipper/downloads/table.go 65.83% <72.72%> (+0.71%) ⬆️
pkg/querier/queryrange/downstreamer.go 95.29% <0.00%> (-2.36%) ⬇️
pkg/canary/comparator/comparator.go 76.36% <0.00%> (-1.82%) ⬇️
pkg/logql/evaluator.go 91.64% <0.00%> (+0.40%) ⬆️
pkg/promtail/targets/file/filetarget.go 66.19% <0.00%> (+2.11%) ⬆️
pkg/promtail/positions/positions.go 58.51% <0.00%> (+11.70%) ⬆️

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I think you just need to tm.Stop line 70 in the table_manager.go

@sandeepsukhani sandeepsukhani force-pushed the boltdb-shipper-query-readiness branch from 6320ea2 to 4cfe998 Compare November 18, 2020 11:45
@sandeepsukhani sandeepsukhani merged commit cd723c0 into grafana:master Nov 18, 2020
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
* fix calling of stop method on series store

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* do not embed fetcher in seriesStore to avoid errors

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants