[#1695] qos: Add treesync tag
All checks were successful
Build / Build Components (push) Successful in 2m24s
Pre-commit hooks / Pre-commit (push) Successful in 2m43s
Vulncheck / Vulncheck (push) Successful in 3m15s
Tests and linters / gopls check (push) Successful in 5m1s
OCI image / Build container images (push) Successful in 5m36s
Tests and linters / Lint (push) Successful in 6m17s
Tests and linters / Staticcheck (push) Successful in 6m16s
Tests and linters / Run gofumpt (push) Successful in 6m29s
Tests and linters / Tests (push) Successful in 9m40s
Tests and linters / Tests with -race (push) Successful in 9m41s
All checks were successful
Build / Build Components (push) Successful in 2m24s
Pre-commit hooks / Pre-commit (push) Successful in 2m43s
Vulncheck / Vulncheck (push) Successful in 3m15s
Tests and linters / gopls check (push) Successful in 5m1s
OCI image / Build container images (push) Successful in 5m36s
Tests and linters / Lint (push) Successful in 6m17s
Tests and linters / Staticcheck (push) Successful in 6m16s
Tests and linters / Run gofumpt (push) Successful in 6m29s
Tests and linters / Tests (push) Successful in 9m40s
Tests and linters / Tests with -race (push) Successful in 9m41s
Tree sync is too much different from GC and rebuild to use the same tag for GC and tree sync. Change-Id: Ib44d5fa9a88daff507d759d0b0410cc9272e236f Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
049a650b89
commit
eea46a599d
6 changed files with 13 additions and 4 deletions
|
@ -26,7 +26,7 @@ func NewAdjustOutgoingIOTagUnaryClientInterceptor() grpc.UnaryClientInterceptor
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tag = IOTagClient
|
tag = IOTagClient
|
||||||
}
|
}
|
||||||
if tag == IOTagBackground || tag == IOTagPolicer || tag == IOTagWritecache {
|
if tag.IsLocal() {
|
||||||
tag = IOTagInternal
|
tag = IOTagInternal
|
||||||
}
|
}
|
||||||
ctx = tagging.ContextWithIOTag(ctx, tag.String())
|
ctx = tagging.ContextWithIOTag(ctx, tag.String())
|
||||||
|
@ -44,7 +44,7 @@ func NewAdjustOutgoingIOTagStreamClientInterceptor() grpc.StreamClientIntercepto
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tag = IOTagClient
|
tag = IOTagClient
|
||||||
}
|
}
|
||||||
if tag == IOTagBackground || tag == IOTagPolicer || tag == IOTagWritecache {
|
if tag.IsLocal() {
|
||||||
tag = IOTagInternal
|
tag = IOTagInternal
|
||||||
}
|
}
|
||||||
ctx = tagging.ContextWithIOTag(ctx, tag.String())
|
ctx = tagging.ContextWithIOTag(ctx, tag.String())
|
||||||
|
|
|
@ -74,7 +74,7 @@ func createScheduler(config limits.OpConfig) (scheduler, error) {
|
||||||
|
|
||||||
func converToSchedulingTags(limits []limits.IOTagConfig) map[string]scheduling.TagInfo {
|
func converToSchedulingTags(limits []limits.IOTagConfig) map[string]scheduling.TagInfo {
|
||||||
result := make(map[string]scheduling.TagInfo)
|
result := make(map[string]scheduling.TagInfo)
|
||||||
for _, tag := range []IOTag{IOTagClient, IOTagBackground, IOTagInternal, IOTagPolicer, IOTagWritecache} {
|
for _, tag := range []IOTag{IOTagClient, IOTagBackground, IOTagInternal, IOTagPolicer, IOTagWritecache, IOTagTreeSync} {
|
||||||
result[tag.String()] = scheduling.TagInfo{
|
result[tag.String()] = scheduling.TagInfo{
|
||||||
Share: defaultShare,
|
Share: defaultShare,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ var statTags = map[string]struct{}{
|
||||||
IOTagPolicer.String(): {},
|
IOTagPolicer.String(): {},
|
||||||
IOTagWritecache.String(): {},
|
IOTagWritecache.String(): {},
|
||||||
IOTagCritical.String(): {},
|
IOTagCritical.String(): {},
|
||||||
|
IOTagTreeSync.String(): {},
|
||||||
unknownStatsTag: {},
|
unknownStatsTag: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ const (
|
||||||
IOTagClient IOTag = "client"
|
IOTagClient IOTag = "client"
|
||||||
IOTagInternal IOTag = "internal"
|
IOTagInternal IOTag = "internal"
|
||||||
IOTagBackground IOTag = "background"
|
IOTagBackground IOTag = "background"
|
||||||
|
IOTagTreeSync IOTag = "treesync"
|
||||||
IOTagWritecache IOTag = "writecache"
|
IOTagWritecache IOTag = "writecache"
|
||||||
IOTagPolicer IOTag = "policer"
|
IOTagPolicer IOTag = "policer"
|
||||||
IOTagCritical IOTag = "critical"
|
IOTagCritical IOTag = "critical"
|
||||||
|
@ -34,6 +35,8 @@ func FromRawString(s string) (IOTag, error) {
|
||||||
return IOTagWritecache, nil
|
return IOTagWritecache, nil
|
||||||
case string(IOTagPolicer):
|
case string(IOTagPolicer):
|
||||||
return IOTagPolicer, nil
|
return IOTagPolicer, nil
|
||||||
|
case string(IOTagTreeSync):
|
||||||
|
return IOTagTreeSync, nil
|
||||||
default:
|
default:
|
||||||
return ioTagUnknown, fmt.Errorf("unknown tag %s", s)
|
return ioTagUnknown, fmt.Errorf("unknown tag %s", s)
|
||||||
}
|
}
|
||||||
|
@ -50,3 +53,7 @@ func IOTagFromContext(ctx context.Context) string {
|
||||||
}
|
}
|
||||||
return tag
|
return tag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t IOTag) IsLocal() bool {
|
||||||
|
return t == IOTagBackground || t == IOTagPolicer || t == IOTagWritecache || t == IOTagTreeSync
|
||||||
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ func validateTags(configTags []limits.IOTagConfig) error {
|
||||||
IOTagBackground: {},
|
IOTagBackground: {},
|
||||||
IOTagWritecache: {},
|
IOTagWritecache: {},
|
||||||
IOTagPolicer: {},
|
IOTagPolicer: {},
|
||||||
|
IOTagTreeSync: {},
|
||||||
}
|
}
|
||||||
for _, t := range configTags {
|
for _, t := range configTags {
|
||||||
tag, err := FromRawString(t.Tag)
|
tag, err := FromRawString(t.Tag)
|
||||||
|
|
|
@ -85,7 +85,7 @@ func New(opts ...Option) *Service {
|
||||||
|
|
||||||
// Start starts the service.
|
// Start starts the service.
|
||||||
func (s *Service) Start(ctx context.Context) {
|
func (s *Service) Start(ctx context.Context) {
|
||||||
ctx = tagging.ContextWithIOTag(ctx, qos.IOTagBackground.String())
|
ctx = tagging.ContextWithIOTag(ctx, qos.IOTagTreeSync.String())
|
||||||
go s.replicateLoop(ctx)
|
go s.replicateLoop(ctx)
|
||||||
go s.syncLoop(ctx)
|
go s.syncLoop(ctx)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue