Skip to content

Conversation

@GiedriusS
Copy link

Add experiment support for caching select() requests. Only local tests for now. Cache works on matching identical request signatures. Data is cached only on io.EOF error; if something else occurs then the response is not cached.

Signed-off-by: Giedrius Statkevičius [email protected]

Add experiment support for caching select() requests. Only local tests
for now. Cache works on matching identical request signatures. Data is
cached only on io.EOF error; if something else occurs then the response
is not cached.

Signed-off-by: Giedrius Statkevičius <[email protected]>
@GiedriusS GiedriusS force-pushed the v0.29.0+vinted_caching_exp branch from 462632b to 6f22322 Compare December 14, 2022 15:30

// StoreClientGRPCOpts creates gRPC dial options for connecting to a store client.
func StoreClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure, skipVerify bool, cert, key, caCert, serverName string) ([]grpc.DialOption, error) {
func StoreClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure, skipVerify bool, cert, key, caCert, serverName string, maxCacheSize model.Bytes) ([]grpc.DialOption, error) {
Copy link

@Titasp Titasp Dec 14, 2022

Choose a reason for hiding this comment

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

Style question, wouldn't it be better to refactor long function like this? (so that you wouldn't need to use horizontal slider to see all function params 😄 )

func StoreClientGRPCOpts(
  logger log.Logger, 
  reg *prometheus.Registry, 
  tracer opentracing.Tracer,
  secure, skipVerify bool, 
  cert, key, caCert, serverName string, 
  maxCacheSize model.Bytes,
) ([]grpc.DialOption, error) {
   //...
}

}
}

var fetchKeys = make([]string, 0, numKeys)
Copy link

Choose a reason for hiding this comment

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

style nit: var fetchKeys = ... -> fetchKeys := make([]string, 0, numKeys) ?

Copy link

@Titasp Titasp left a comment

Choose a reason for hiding this comment

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

i trust u

@GiedriusS GiedriusS changed the title query: add experiment Select() cache query: add experimental Select() cache Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants