Fixing overlord issued too many redirects#12908
Merged
abhishekagarwal87 merged 2 commits intoapache:masterfrom Aug 17, 2022
Merged
Fixing overlord issued too many redirects#12908abhishekagarwal87 merged 2 commits intoapache:masterfrom
abhishekagarwal87 merged 2 commits intoapache:masterfrom
Conversation
abhishekagarwal87
approved these changes
Aug 17, 2022
gianm
reviewed
Oct 14, 2022
| if (redirectCount >= MAX_REDIRECTS) { | ||
| retVal.setException(new RpcException("Service [%s] issued too many redirects", serviceName)); | ||
| retVal.setException(new RpcException( | ||
| "Service [%s] redirected too many times [%d] to invalid url %s", |
Contributor
There was a problem hiding this comment.
The error message here isn't right: the url isn't known to be invalid at this point. It may very well be valid. It just exceeded the limit on number of redirects.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While debugging a cluster, I found that during an overlord switch, the tasks were failing.
The task log showed
Which lead me to debug the overlord redirect code.
The
RedirectFilteron the overlord checks if the current node is the elected leader and is initialized usingTaskMaster.isLeader()and if no, redirect it to the elected leader usingoverlordLeaderSelector.getCurrentLeader().Now the
redirectFilterwas redirecting requests to itself resulting in a never-ending loop until the initialized flag is set hence causingissued too many redirectsfor the clients.Note that the new leader may take some time to set the initialized flag as it has to fetch tasks/locks from the metadatastore.
Adjusted the code in such a way that the
redirectFilterwill not redirect the requests to itself resulting in aSC_SERVICE_UNAVAILABLE = 503which will cause the overlord clients to back off exponentially which IMHO is the correct behaviour.Key changed/added classes in this PR
TaskMasterThis PR has: