Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: Make extend_recipe requests poll if they take too long
The current (simplistic) behavior of *always* running `extend_recipe` synchronously doesn't work well in the case of *very* large migrations, which can take arbitrarily long - basically whatever we set the RPC timeout to, there will be a migration at some point that takes longer than that timeout. We don't want to *not* set timeouts, though, since timeouts are important to catch cases such as network hangs and partitions, etc. To work around that, this commit splits the extend_recipe RPC into two parts: 1. The existing /extend_recipe RPC, which tries to run the migration synchronously for up to 5 seconds. If it takes longer, it leaves it running in the background (storing its JoinHandle inside a new `pending_migrations` field in the Leader) and returns a "handle" to it which can be used by: 2. A new /migration_status RPC, which checks the status of a migration that's running in the background. The `extend_recipe` method in Controller now uses these two RPCs, polling /migration_status every 1 second if /extend_recipe returns Pending. This has no real effect on the user (everything still *appears* synchronous) except that migrations which take longer than `self.migration_timeout` no longer time out. Fixes: ENG-3029 Change-Id: Id5e58510ca7961bd6cb3d81b2a365726453da83a Reviewed-on: https://gerrit.readyset.name/c/readyset/+/4925 Tested-by: Buildkite CI Reviewed-by: Fran Noriega <fran@readyset.io>
- Loading branch information
1 parent
2af1dea
commit 1b77183
Showing
6 changed files
with
148 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters