-
Notifications
You must be signed in to change notification settings - Fork 112
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
[WIP] Performance tuning #3932
base: edge
Are you sure you want to change the base?
[WIP] Performance tuning #3932
Conversation
replace the prepared service registry with a go micro service registry
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@@ -300,13 +300,18 @@ | |||
return u, tokenScope, nil | |||
} | |||
|
|||
func getUserGroups(ctx context.Context, u *userpb.User, client gatewayv1beta1.GatewayAPIClient) ([]string, error) { | |||
func getUserGroups(ctx context.Context, u *userpb.User, selector pool.Selectable[gateway.GatewayAPIClient]) ([]string, 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.
missing ',' in parameter list
@@ -124,13 +128,18 @@ func expandAndVerifyScope(ctx context.Context, req interface{}, tokenScope map[s | |||
return errtypes.PermissionDenied(fmt.Sprintf("access to resource %+v not allowed within the assigned scope", req)) | |||
} | |||
|
|||
func resolveLightweightScope(ctx context.Context, ref *provider.Reference, scope *authpb.Scope, user *userpb.User, client gateway.GatewayAPIClient, mgr token.Manager) error { | |||
func resolveLightweightScope(ctx context.Context, ref *provider.Reference, scope *authpb.Scope, user *userpb.User, selector pool.Selectable[gateway.GatewayAPIClient], mgr token.Manager) 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.
missing ',' in parameter list (and 10 more errors)
@@ -163,6 +166,8 @@ | |||
providerCache cache.ProviderCache | |||
createHomeCache cache.CreateHomeCache | |||
createPersonalSpaceCache cache.CreatePersonalSpaceCache | |||
authRegistrySelector pool.Selectable[auth.RegistryAPIClient] |
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.
expected ';', found '[' (and 2 more errors)
"strings" | ||
|
||
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" | ||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" |
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.
expected ';', found '[' (and 10 more errors)
|
||
// Options represent options | ||
type Options struct { | ||
GatewaySelector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 2 more errors)
// Handler handles propfind requests | ||
type Handler struct { | ||
PublicURL string | ||
getClient GetGatewayServiceClientFunc | ||
selector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 10 more errors)
@@ -37,8 +38,8 @@ import ( | |||
// LookupReferenceForPath returns: | |||
// a reference with root and relative path | |||
// the status and error for the lookup | |||
func LookupReferenceForPath(ctx context.Context, client gateway.GatewayAPIClient, path string) (*storageProvider.Reference, *rpc.Status, error) { | |||
space, cs3Status, err := LookUpStorageSpaceForPath(ctx, client, path) | |||
func LookupReferenceForPath(ctx context.Context, selector pool.Selectable[gateway.GatewayAPIClient], path string) (*storageProvider.Reference, *rpc.Status, 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.
missing ',' in parameter list (and 1 more errors)
@@ -161,7 +168,7 @@ func (s *svc) handleTPCPull(ctx context.Context, w http.ResponseWriter, r *http. | |||
fmt.Fprintf(w, "success: Created") | |||
} | |||
|
|||
func (s *svc) performHTTPPull(ctx context.Context, client gateway.GatewayAPIClient, r *http.Request, w http.ResponseWriter, ns string) error { | |||
func (s *svc) performHTTPPull(ctx context.Context, selector pool.Selectable[gateway.GatewayAPIClient], r *http.Request, w http.ResponseWriter, ns string) 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.
missing ',' in parameter list
|
||
// ID returns the node ID. | ||
ID() string | ||
func GetRegistry() mRegistry.Registry { |
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.
exported function GetRegistry should have comment or be unexported
// CS3 represents a metadata storage with a cs3 storage backend | ||
type CS3 struct { | ||
providerAddr string | ||
gatewayAddr string | ||
providerSelector pool.Selectable[provider.ProviderAPIClient] |
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.
expected ';', found '[' (and 5 more errors)
"google.golang.org/grpc/metadata" | ||
) | ||
|
||
// Impersonate returns an authenticated reva context and the user it represents | ||
func Impersonate(userID *user.UserId, gwc gateway.GatewayAPIClient, machineAuthAPIKey string) (context.Context, *user.User, error) { | ||
usr, err := GetUser(userID, gwc, machineAuthAPIKey) | ||
func Impersonate(userID *user.UserId, selector pool.Selectable[gateway.GatewayAPIClient], machineAuthAPIKey string) (context.Context, *user.User, 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.
missing ',' in parameter list (and 2 more errors)
@@ -45,7 +46,7 @@ type Options struct { | |||
JWTSecret string | |||
|
|||
FavoriteManager favorite.Manager | |||
GatewayClient gateway.GatewayAPIClient | |||
GatewaySelector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 2 more errors)
@@ -58,7 +58,7 @@ func init() { | |||
|
|||
// Manager implements a publicshare manager using a cs3 storage backend | |||
type Manager struct { | |||
gatewayClient gateway.GatewayAPIClient | |||
gatewaySelector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 7 more errors)
"google.golang.org/grpc" | ||
) | ||
|
||
type Selectable[T any] 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.
expected ']', found any (and 4 more errors)
@@ -145,8 +149,8 @@ type Manager struct { | |||
|
|||
initialized bool | |||
|
|||
gateway gatewayv1beta1.GatewayAPIClient | |||
eventStream events.Stream | |||
gatewaySelector pool.Selectable[gatewayv1beta1.GatewayAPIClient] |
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.
expected ';', found '[' (and 10 more errors)
item PermissionsChecker // handles item permissions | ||
space CS3PermissionsClient // handlers space permissions | ||
item PermissionsChecker // handles item permissions | ||
space pool.Selectable[cs3permissions.PermissionsAPIClient] // handlers space permissions |
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.
expected ';', found '[' (and 2 more errors)
@@ -39,14 +40,14 @@ type Downloader interface { | |||
} | |||
|
|||
type revaDownloader struct { | |||
gtw gateway.GatewayAPIClient | |||
selector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 2 more errors)
@@ -46,12 +47,12 @@ type Walker interface { | |||
} | |||
|
|||
type revaWalker struct { | |||
gtw gateway.GatewayAPIClient | |||
selector pool.Selectable[gateway.GatewayAPIClient] |
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.
expected ';', found '[' (and 2 more errors)
This is work in progress where we document some performance tweaks we made when running on a large scale deployment. We will extract individual PRs from this to make reviewing easier.