-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native] Enable node pool type specification when reporting to the coordinator from a C++ worker #24569
Conversation
New release note guidelines. Please remove the manual PR link in the following format from the release note entries for this PR.
I have updated the Release Notes Guidelines to remove the examples of manually adding the PR link. |
@jaystarshot : Is the node pool type an optimization or it affects functionality as well ? So if a non-leaf worker received a TableScan would it throw error ? |
@aditi-pandit The coordinator won’t send a non leaf fragment. If it does i believe the execution should be normal since there is no blocking logic in the worker. |
@majetideepak can you please take a look |
@@ -241,6 +241,7 @@ void PrestoServer::run() { | |||
address_ = fmt::format("[{}]", address_); | |||
} | |||
nodeLocation_ = nodeConfig->nodeLocation(); | |||
nodePoolType_ = systemConfig->poolType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the possible values for pool Type ? Might be good to validate the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The accepted values are here Sure I can add that
@@ -290,6 +290,12 @@ std::string SystemConfig::prestoVersion() const { | |||
return requiredProperty(std::string(kPrestoVersion)); | |||
} | |||
|
|||
std::string SystemConfig::poolType() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to confirm that this is not a registered property... Else it has to be a part of registeredProps_. If you add it to registeredProps_ it might be simpler to initialize the default value as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between registeredProps_ and configs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registered properties are validated on server startup https://github.com/prestodb/presto/blob/master/presto-native-execution/presto_cpp/main/common/Configs.cpp#L110
Might be better to add it to avoid warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaystarshot : Just had 2 questions else this PR should be fine.
@aditi-pandit I am just using the same property name as presto java uses. Its defined in serverconfig here. |
Thanks @jaystarshot for the explanation. I saw the linked PR later. Yeah, we'll have to stick with this name. |
7088f2f
to
bc3388d
Compare
@pdabre12 @pramodsatya : Can you'll take a look at the failures in prestocpp-linux-build-and-unit-test / prestocpp-linux-presto-sidecar-tests (pull_request) |
Suggest rephrasing of release note entry to follow the Order of changes, and Order of sections grouping in the Release Notes Guidelines:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaystarshot : Have one major comment about the required vs optional. The rest are nits.
Another thing : Please change your commit to add a prefix of [native]
@@ -290,6 +291,16 @@ std::string SystemConfig::prestoVersion() const { | |||
return requiredProperty(std::string(kPrestoVersion)); | |||
} | |||
|
|||
std::string SystemConfig::poolType() const { | |||
static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; | |||
auto value = requiredProperty(std::string(kPoolType)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be optionalProperty instead ? Configs which don't have pool-type will cause failures post this change. So this could be very disruptive. Could that be the reason for all the test failures ? I haven't looked at the details but the timeouts most likely could be because the workers didn't start up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought the default will always be initialized when we put this in the registeredProps_ map i can try with optional
@@ -290,6 +291,16 @@ std::string SystemConfig::prestoVersion() const { | |||
return requiredProperty(std::string(kPrestoVersion)); | |||
} | |||
|
|||
std::string SystemConfig::poolType() const { | |||
static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit rename variable to kPoolTypes.
Constant variable names should be prefixed with 'k'
@@ -34,6 +34,7 @@ class Announcer : public PeriodicServiceInventoryManager { | |||
const bool sidecar, | |||
const std::vector<std::string>& connectorIds, | |||
const uint64_t maxFrequencyMs_, | |||
const std::string& nodePoolType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move this parameter higher up since there aren't any optional parameters in this method. After nodeLocation or sidecar ?
bc3388d
to
fe3a38b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaystarshot : Please change your commit title to have prefix [native] as well.
One minor nit otherwise.
@@ -290,6 +291,17 @@ std::string SystemConfig::prestoVersion() const { | |||
return requiredProperty(std::string(kPrestoVersion)); | |||
} | |||
|
|||
std::string SystemConfig::poolType() const { | |||
static const std::unordered_set<std::string> validTypes = {"LEAF", "INTERMEDIATE", "DEFAULT"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Rename this set of constants with k Prefix as well. kPoolTypes maybe
fe3a38b
to
4573986
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the iterations @jaystarshot
4573986
to
38b72d5
Compare
38b72d5
to
77690d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test change @jaystarshot
Description
Presto supports splitting workers into leaf and non leaf pools. This was added here.
For this the coordinator needs
worker-isolation-enabled=true
and workers can report their pool_type to the resource manager.Adding the same configs in presto c++ so that the announcer can report the node type.
With this (since support was already added in coordinator) one can deploy any combination of native/java workers in LEAF/INTERMEDIATE etc.
Motivation and Context
Impact
Test Plan
Tested that setting works and if we set pool_type=LEAF in presto c++ the coordinator will only schedule leaf tasks there
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.