-
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
tsdb index gateway #6158
tsdb index gateway #6158
Conversation
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.
Did a quick review; this is looking good!
Please do not merge this PR until we are ready to enable new grpc calls or we add a flag to control it since we had disabled them until we can improve index gateway performance.
Instead, can we create two clients, one which uses the new form and one which uses the old form? Then we can enable the new form when tsdb is enabled, but keep the old form elsewhere.
|
||
// TODO(owen-d): add TSDB index-gateway support | ||
// ToDo(Sandeep): Refactor code to not use boltdb-shipper index gateway client config | ||
if shouldUseBoltDBIndexGatewayClient(s.cfg) { |
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 may be better to have this function accept on the tsdb-shipper config as an argument instead.
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 should all be cleaned up once I get to migrate boltdb-shipper
to index-shipper
.
@@ -25,17 +25,6 @@ type StoreLimits interface { | |||
MaxQueryLength(userID string) time.Duration | |||
} | |||
|
|||
type Index interface { |
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.
Why did we move this into series.IndexStore
?
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 wanted to pass an interface to series.NewIndexGatewayClientStore without which it was not possible to pass tsdb index client. I had to move it to series.IndexStore
to avoid circular dependency.
} | ||
|
||
type IndexGatewayClient interface { | ||
GetChunkRef(ctx context.Context, in *indexgatewaypb.GetChunkRefRequest, opts ...grpc.CallOption) (*indexgatewaypb.GetChunkRefResponse, error) | ||
GetSeries(ctx context.Context, in *indexgatewaypb.GetSeriesRequest, opts ...grpc.CallOption) (*indexgatewaypb.GetSeriesResponse, error) |
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.
<3 Adding this here, thanks.
idx := tsdb.NewIndexClient(headManager, p) | ||
writer := tsdb.NewChunkWriter(f, p, headManager) | ||
// ToDo(Sandeep): Avoid initializing writer when in read only mode | ||
writer, idx, err := tsdb.NewStore(s.cfg.TSDBShipperConfig, p, f, objectClient, s.limits, indexClientReg) |
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 don't see tsdb.NewStore
implemented yet, is that right? I'm guessing we'll just copy this over to the new function (we can also add a check on whether to enable the head manager as well).
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.
Sorry, I missed pushing the file. I have pushed it yesterday.
We already have a fallback mechanism for backwards compatibility. I think we should add a flag to reuse most of the code then. |
./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.3%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0.1%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
…re ready to enable it again
I have temporarily disabled using |
./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.5%
+ chunkenc 0%
+ logql 0%
+ loki 0.6% |
I think we should move around the |
What this PR does / why we need it:
Special notes for your reviewer: