Fix Server Active State Endpoint#23585
Merged
swapsmagic merged 1 commit intoprestodb:masterfrom Sep 5, 2024
Merged
Conversation
91a3f73 to
8c40f98
Compare
NikhilCollooru
previously approved these changes
Sep 4, 2024
...src/main/java/com/facebook/presto/execution/resourceGroups/InternalResourceGroupManager.java
Outdated
Show resolved
Hide resolved
8c40f98 to
6414c7e
Compare
NikhilCollooru
previously approved these changes
Sep 4, 2024
During start of the cluster, ResourceGroupManagerConfigurationManager is initialized with InitializingConfigurationManager class. And later configuration manager is configured when loadConfigurationManager method is called. But between this time period GET `/v1/info/state` endpoint returns the server state as ACTIVE. And if the server receives any queries during the period, they all fails with SERVER_STARTING_UP error. In this PR, we are addressing that by providing a flag in ResourceGroupConfigurationManager that is been checked and if not true, `/v1/info/state` endpoint return server status as INACTIVE.
6414c7e to
b20afe5
Compare
NikhilCollooru
approved these changes
Sep 5, 2024
tdcmeehan
reviewed
Sep 5, 2024
| private final boolean isResourceManagerEnabled; | ||
| private final QueryManagerConfig queryManagerConfig; | ||
| private final InternalNodeManager nodeManager; | ||
| private boolean isConfigurationManagerLoaded; |
Contributor
There was a problem hiding this comment.
Given that this is mutable and guaranteed to be accessed from multiple threads, you should ensure that there is proper visibility to each thread. Note that where you set this, in loadConfigurationManager, such care has also been taken in other mutated members, like configurationManager. I'd recommend making it an AtomicBoolean.
Contributor
Author
There was a problem hiding this comment.
will send a followup PR to address this.
25 tasks
Contributor
|
Saved that user @swapsmagic is from Meta |
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
GET
/v1/info/stateendpoint to return cluster stateINACTIVEtill resource group configuration manager is not fully loaded.Motivation and Context
During start of the cluster, ResourceGroupManagerConfigurationManager is initialized with InitializingConfigurationManager class. And later configuration manager is configured when loadConfigurationManager method is called. But between this time period GET
/v1/info/stateendpoint returns the server state as ACTIVE. And if the server receives any queries during the period, they all fails with SERVER_STARTING_UP error.Impact
In this PR, we are addressing that by providing a flag in ResourceGroupConfigurationManager that is been checked and if not true,
/v1/info/stateendpoint return server status as INACTIVE.Test Plan
Added unit test to verify the scenario.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.