-
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
Add a config property for excluding invalid worker session properties #23968
base: master
Are you sure you want to change the base?
Add a config property for excluding invalid worker session properties #23968
Conversation
3ec1cc9
to
a9f640f
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 doc! Nit for tense. Pull branch, local doc build, formatting looks good.
Thanks for the release note entry! A couple of nits in the formatting:
|
a9f640f
to
1c80ce0
Compare
@steveburnett Thank you for the suggestions. Please have another look. |
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.
LGTM! (docs)
Pull updated branch, reviewed the new local doc build, looks good. Thanks!
presto-main/src/main/java/com/facebook/presto/SystemSessionProperties.java
Outdated
Show resolved
Hide resolved
4da5af8
to
a0ab00f
Compare
@@ -805,7 +805,9 @@ public ListeningExecutorService createResourceManagerExecutor(ResourceManagerCon | |||
// Worker session property providers | |||
MapBinder<String, WorkerSessionPropertyProvider> mapBinder = | |||
newMapBinder(binder, String.class, WorkerSessionPropertyProvider.class); | |||
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); | |||
if (!featuresConfig.isExcludeJavaWorkerSessionProperties()) { |
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.
if (!featuresConfig.isExcludeJavaWorkerSessionProperties()) { | |
if (!serverConfig.isCoordinatorSidecarEnabled() || !featuresConfig.isExcludeJavaWorkerSessionProperties()) { |
I think we should always include them for Java clusters.
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); | ||
if (!featuresConfig.isExcludeJavaWorkerSessionProperties()) { | ||
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); | ||
} | ||
if (!serverConfig.isCoordinatorSidecarEnabled()) { | ||
mapBinder.addBinding("native-worker").to(NativeWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); |
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.
Do we need the same for native-worker session properties? Maybe the config could have a generic name to exclude properties that aren't relevant for that worker type.
presto-main/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java
Outdated
Show resolved
Hide resolved
a0ab00f
to
9b3f472
Compare
@tdcmeehan @rschlussel Made the changes, now setting the config property should help exclude properties that aren't relevant for that worker type. |
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); | ||
if (!serverConfig.isCoordinatorSidecarEnabled()) { | ||
mapBinder.addBinding("native-worker").to(NativeWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON); | ||
if (featuresConfig.isExcludeInvalidWorkerSessionProperties()) { |
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 think it would be easier to understand if the logic were rearranged a bit like this:
if(featuresConfig.isNativeExecutionEnabled()) {
if(!server.isCoordinatorSidecarEnabled()) {
mapBinder.addBinding("native-worker").to(NativeWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON);
}
if(!featuresConfig.isExcludeInvalidWorkerSessionProperties()) {
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON);
}
}
else {
mapBinder.addBinding("java-worker").to(JavaWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON);
if(!featuresConfig.isExcludeInvalidWorkerSessionProperties()) {
mapBinder.addBinding("native-worker").to(NativeWorkerSessionPropertyProvider.class).in(Scopes.SINGLETON);
}
}
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 suggestion, updated.
@@ -72,14 +72,7 @@ public void testShowSession() | |||
@Test | |||
public void testSetJavaWorkerSessionProperty() |
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.
need a test that when exclude-invalid-session-properties is false that the session properties are visible. (and make sure we have true and false tests both for java and cpp.
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.
9b3f472
to
e36b36e
Compare
@rschlussel Can you please have another look? Thanks. |
|
||
import static com.facebook.presto.testing.TestingSession.testSessionBuilder; | ||
|
||
public class TestSetWorkerSessionPropertiesExcludingInvalidProperties |
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.
Let's just remove the inheritance and create two classes. I feel like that's more straightforward than excluding tests depending on the subclass. Some duplication is OK here.
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.
Updated, thanks.
e36b36e
to
f3033e0
Compare
Resolves: #23827