-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: Port 1.x retention policy enforcement service #19521
Conversation
6c1a5ce
to
faed872
Compare
v1/services/retention/config.go
Outdated
return nil | ||
} | ||
|
||
// TODO: Should we enforce a minimum interval? |
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'm not sure it's worth adding minimums. Hopefully people won't be adjusting this config option at all.
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.
Will remove that comment
v1/services/retention/service.go
Outdated
|
||
config Config | ||
wg sync.WaitGroup | ||
done chan struct{} |
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.
Minor nit. This is probably just ported over from the previous implementation but I like using a cancelable background context instead of a done
channel. It handles idempotency during closing and a lot of things already take a context.Context
.
e.g.
type Service struct {
ctx context.Context
cancel func()
}
func NewService() *Service {
s := &Service{}
s.ctx, s.cancel = context.WithCancel(context.Background())
return s
}
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.
Good shout – I'll alter the Open
method to take a context.Context
Configuration of the check interval is available via ``` --storage-retention-check-interval ``` Closes #19309
* Pass context.Context to Service.Open * Remove redundant comments * Bind to retention.Config configuration to be consistent with 1.x
84f19f4
to
027143a
Compare
Closes #19309
This PR introduces the retention policy enforcement service from InfluxDB 1.x. This service is responsible for evaluating retention policy rules and deleted shards which fall outside the time bounds.
In addition, configuration of the check interval is available via
Finally, due to the introduction of the retention policy service, a number of types and interfaces were removed to keep the static checker happy, as they were no longer used.