Set IO tags #1608
No reviewers
TrueCloudLab/storage-core-committers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1608
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/tagging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
critical
always setcritical
andinternal
are allowedwritecache
is used for writecache flushpolicer
is used for policer local requestsbackground
is used for tree sync and gc9442a1d2ee
toa88085f38b
a88085f38b
toca6e997706
ca6e997706
to19bab4bf9a
19bab4bf9a
toe43c9d73fd
4ab08d1efe
toa253afef44
@ -34,11 +33,9 @@ func _client() (tree.TreeServiceClient, error) {
opts := []grpc.DialOption{
grpc.WithChainUnaryInterceptor(
metrics.NewUnaryClientInterceptor(),
No need for metric in frostfs-cli
@ -53,1 +56,3 @@
c.cfgControlService.server = grpc.NewServer()
c.cfgControlService.server = grpc.NewServer(
grpc.ChainUnaryInterceptor(
qos.NewSetCriticalIOTagUnaryServerInterceptor(),
First interceptor is the outer most, so it will be incoming RPC -> set IO tag critical -> metrics -> tracing
a253afef44
toee8140d50b
@ -130,10 +131,12 @@ func getGrpcServerOpts(ctx context.Context, c *cfg, sc *grpcconfig.Config) ([]gr
serverOpts := []grpc.ServerOption{
grpc.MaxRecvMsgSize(maxRecvMsgSize),
grpc.ChainUnaryInterceptor(
qos.NewUnaryServerInterceptor(),
This is the outer most interceptor, so so it will be incoming RPC -> parse and set IO tag -> metrics -> tracing
WIP: Set IO tagsto Set IO tagsee8140d50b
to5899ed74f3
@ -510,4 +510,7 @@ const (
BlobovniczatreeFailedToRemoveRebuildTempFile = "failed to remove rebuild temp file"
WritecacheCantGetObject = "can't get an object from fstree"
FailedToUpdateMultinetConfiguration = "failed to update multinet configuration"
FailerToParseIncommingIOTag = "failed to parse incomming IO tag"
FailerToParseIncommingIOTag -> FailedToParseIncommingIOTag
fixed
5899ed74f3
tob4a5aabc89
b4a5aabc89
toaf028748ea
New commits pushed, approval review dismissed automatically according to repository settings
af028748ea
to7a7ec844c2
@ -0,0 +13,4 @@
AdjustIncommingTag(ctx context.Context, requestSignPublicKey []byte) context.Context
}
type qoSObjectService struct {
qoSObjectService
->qosObjectService
? :)fixed
998f7a18b7
to2faffe8372
Awesome
@ -54,0 +59,4 @@
metrics.NewUnaryServerInterceptor(),
tracing.NewUnaryServerInterceptor(),
),
// control service has no stream methods, so no stream interceptors added
When it will have stream methods, we won't remember this line.
Is there any problem with adding them?
Just I don't want to add something I can't test.
@ -101,6 +101,7 @@ func initApp(ctx context.Context, c *cfg) {
initAndLog(ctx, c, "gRPC", func(c *cfg) { initGRPC(ctx, c) })
initAndLog(ctx, c, "netmap", func(c *cfg) { initNetmapService(ctx, c) })
initAndLog(ctx, c, "qos", func(c *cfg) { initQoSService(c) })
Could you explain, why do we have both interceptor and service?
See comment about tree service: #1608 (comment)
@ -0,0 +62,4 @@
}
nm, err := s.netmapSource.GetNetMap(0)
if err != nil {
s.logger.Error(ctx, logs.FailedToGetNetmapToAdjustIOTag, zap.Error(err))
I won't be so sure about
Error
-- it could be done on every request.How about
debug
?Not insisting.
Ok, fixed
@ -0,0 +70,4 @@
return ctx
}
}
return qosTagging.ContextWithIOTag(ctx, qos.IOTagClient.String())
Does
qos.IOTagClient.String()
allocate?It seems constant, so better be it.
@ -226,2 +226,4 @@
FROSTFS_MULTINET_RESTRICT=false
FROSTFS_MULTINET_FALLBACK_DELAY=350ms
FROSTFS_QOS_CRITICAL_AUTHORIZED_KEYS="035839e45d472a3b7769a2a1bd7d54c4ccd4943c3b40f547870e83a8fcbfb3ce11 028f42cfcb74499d7b15b35d9bff260a1c8d27de4f446a627406a382d8961486d6"
Could you provide a different pair of keys for different section?
Testing same keys easily misses copy-paste errors.
done
@ -140,3 +140,3 @@
},
"get": {
"priority": ["$attribute:ClusterName", "$attribute:UN-LOCODE"]
"priority": [
Please, move formatting changes to a separate commit.
Or, better, leave as is, because someone else will change that again if we don't have this automated.
fixed
@ -381,6 +387,7 @@ func (s *Service) SynchronizeAll() error {
}
func (s *Service) syncLoop(ctx context.Context) {
ctx = tagging.ContextWithIOTag(ctx, qos.IOTagBackground.String())
Why have you decided to put it inside the function and not at the callsite?
Right, moved
@ -40,0 +24,4 @@
l.z.Error(msg, appendContext(ctx, fields...)...)
}
func appendContext(ctx context.Context, fields ...zap.Field) []zap.Field {
@acid-ant please, look
The PR with logging tags will be adapted, depending on the merge order.
Yeah, saw this, merge will be easy.
@ -0,0 +25,4 @@
}
func (i *ioTagAdjust) Add(ctx context.Context, req *AddRequest) (*AddResponse, error) {
ctx = i.a.AdjustIncommingTag(ctx, req.GetSignature().GetKey())
I don't understand all these different places where we work with tags.
Consider tree service: we have 2 interceptors and also
NewIOTagAdjustServer
.Why are all those different?
tagging.NewUnaryServerInterceptor()
andtagging.NewStreamServerInterceptor()
extract an IO tag from the metadata of incommin grpc request and store it in the context.Context. They don't know anything about frostfs-node allowed tags.tagging.NewUnaryClientInteceptor()
andtagging.NewStreamClientInterceptor()
extract an IO tag from context.Context and store it in the metadata of outcomming grpc request. They also don't know anything about frostfs-node allowed tags.AdjustIncommingTag
checks if incomming request's signer has rights to useinternal
orcritical
IO tag and also that tag has allowed value.qos.NewAdjustOutgoingIOTagUnaryClientInterceptor()
andqos.NewAdjustOutgoingIOTagStreamClientInterceptor()
replacebackground
,policer
andwritecache
tag values withinternal
IO tag value for outcomming requests.Regarding (4), I think there is a slight confusion:
Any thread, initiating network request could set its meta explicitly (policer, replicator).
And writecache doesn't create network requests, for example.
Do you think introducing interceptor is a better solution, than explicit
internal
on all callsites?Thanks, it became clearer know.
Adjust
doesn't scream VALIDATION, thats where my confusion came from.I tried, but it looked very scary (especially in policer/replicator).
@ -0,0 +40,4 @@
}
}
func (s *cfgQoSService) AdjustIncommingTag(ctx context.Context, requestSignPublicKey []byte) context.Context {
Typo
AdjustIncommingTag
->AdjustIncomingTag
fixed
This typo still appears in many places, including commit messages. Please make sure to fix it everywhere
fixed
2faffe8372
to1d7cbd5b9a
New commits pushed, approval review dismissed automatically according to repository settings
1d7cbd5b9a
to557678321a
557678321a
to12206c7658
12206c7658
toa63fc2f2d8
a63fc2f2d8
to447d93e9fd
447d93e9fd
toa3622fb250
a3622fb250
to3b8ca0d538
New commits pushed, approval review dismissed automatically according to repository settings
3b8ca0d538
to5d79abe523