redpanda
redpanda copied to clipboard
Graceful shutdown while the uploads or downloads to/from S3 are active
Cover letter
Introduce two new methods:
- start_constructing_service that creates the sharded server without adding a functor to _deferred list.
- finish_constructing_service that adds a functor to the _deferred list (if the corresponding sharded service is initialized).
Initialize 'cloud_storage_api' using the first method, then initialize services that depend on it and only after that call 'finish_constructing_service'.
This is needed because to guarantee faster shutdown of the redpanda process. Currently, redpanda has to wait until all active uploads and downloads will be completed and only after that the shutdown will proceed. This is because the services which are using 'cloud_storage_api' will be stopped first (since they're created after the 'cloud_storage_api').
This commit changes the order in which the services will be stopped. The 'cloud_storage_api' will be stopped first causing all active uploads/downloads to fail.
Fixes #5811
Backport Required
- [ ] not a bug fix
- [ ] papercut/not impactful enough to backport
- [x] v22.2.x
- [x] v22.1.x
- [ ] v21.11.x
UX changes
none
Release notes
- none
Features
- none
Improvements
- none
It seems that cover letter needs an update