-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
make index shipper read path handle range of tables by type of index #6304
make index shipper read path handle range of tables by type of index #6304
Conversation
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0.3%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0.3%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
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.
This looks great. One thing I think we should add is support for skipping files within a table. For instance, consider two period configs (I know we're hardcoding period to 24h now, but it's a configurable field and should/can be configurable in the future IMO):
- boltdb, period=24h
- tsdb, period=48h
It's possible for an earlier timestamp (i.e. 72h) to have the same bucket as a later one (144h) because 72h / 24h = 3
and 144h / 48h = 3
.
Approving in the meantime :)
Yeah, I think we will have to keep the file name format unique to be able to distinguish between different index file types. |
./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0.4%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
What this PR does / why we need it:
We run one
indexshipper
instance for eachboltdb-shipper
andtsdb
instance. While initializingindexshipper
, both the stores pass an index specific OpenIndexFileFunc to helpindexshipper
open the index files without having to make it aware of the file types or the way to interpret them.If Loki is using both
boltdb-shipper
andtsdb
for the index store and has the same local and/or object storage path configured for storing the index files, it fails to run because the genericindexshipper
running for both the store types tries to open both types of index files using the sameOpenIndexFileFunc
.This PR makes
indexshipper
accept a range of table numbers to handle only specific tables i.e it would sync and load-on-startup only specific tables. The table number ranges are calculated based on the configured schema start/end date and the index period of both the index types.Checklist