Fix race condition in InternalResourceManager initialization#19067
Merged
rschlussel merged 1 commit intoprestodb:masterfrom Feb 16, 2023
Merged
Fix race condition in InternalResourceManager initialization#19067rschlussel merged 1 commit intoprestodb:masterfrom
rschlussel merged 1 commit intoprestodb:masterfrom
Conversation
9939ea3 to
1a25304
Compare
Contributor
|
Can we add a test to verify query failure behavior when configuration manager is not fully initialized? |
jainxrohit
reviewed
Feb 16, 2023
Contributor
There was a problem hiding this comment.
Do we need this local variable? initializingConfigurationManager
We should be able to initialize member variable initializingConfigurationManager directly?
1a25304 to
6cd3177
Compare
Contributor
Author
|
added tests |
6cd3177 to
bca80f2
Compare
swapsmagic
approved these changes
Feb 16, 2023
Contributor
Author
|
validated on a test cluster that throws lots of queries at the cluster right a way. a bunch of queries failed with "Presto server is still initializing", and then had a successful query and future queries succeeded. |
ajaygeorge
approved these changes
Feb 16, 2023
...va/com/facebook/presto/execution/resourceGroups/LegacyResourceGroupConfigurationManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/facebook/presto/execution/resourceGroups/InternalResourceGroupManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/facebook/presto/execution/resourceGroups/InternalResourceGroupManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/facebook/presto/execution/resourceGroups/InternalResourceGroupManager.java
Outdated
Show resolved
Hide resolved
Throw an exception if a query tries to create resource groups before the configuration manager has been loaded. This fixes a race condition where a query can start constructing resource groups before the ResourceGroupConfigurationManager is loaded. This would cause some resource groups to get created in the legacy manager and never recreated when the new resource manager is loaded. This is one theory about why we are seeing some clusters get into a state on restart where all queries fail with a NullPointerException in ReloadingResourceGroupConfigurationManager.
bca80f2 to
4ce055e
Compare
12 tasks
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.
Throw an exception if a query tries to create resource groups before the configuration manager has been loaded. This fixes a race condition where a query can start constructing resource groups before the ResourceGroupConfigurationManager is loaded. This would cause some resource groups to get created in the legacy manager and never recreated when the new resource manager is loaded. This is one theory about why we are seeing some clusters get into a state on restart where all queries fail with a NullPointerException in ReloadingResourceGroupConfigurationManager.
Test plan - CI, new unit tests, validated fix on test cluster