Skip to content
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

[FLINK-30554][sql-client] Remove useless sessionId in the Executor #21597

Merged
merged 2 commits into from Jan 9, 2023

Conversation

fsk119
Copy link
Member

@fsk119 fsk119 commented Jan 4, 2023

What is the purpose of the change

Remove useless sessionId in the Executor. The SQL Gateway uses the SessionHandle to identify each Session and the SessionHandle is assigned by the Gateway only. The Executor in the SqlClient is the client to submit messages to the
Gateway and it is only used by the current Session. We don't need to use the sessionId everywhere.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 4, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@fsk119
Copy link
Member Author

fsk119 commented Jan 4, 2023

@flinkbot run azure

Copy link
Contributor

@swuferhong swuferhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @fsk119 , I left some comments

*/
Map<String, String> getSessionConfigMap(String sessionId) throws SqlExecutionException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question. Original LocalExecutor implements Executor have a map ConcurrentHashMap<String, SessionContext> contextMap, but now, we just delete it. Does this mean that each executor can only have one session? (If that, why we need sessionId, we can just define an executorId instead ? ). Also, I think if you delete this contextMap, you need add tests to verify we don't need this map. WDYT ?

Copy link
Member Author

@fsk119 fsk119 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that each executor can only have one session?

Yes, you are right. Executor only works for one session in the new design. The Gateway is designed for the multitenancy.

why we need sessionId, we can just define an executorId instead?

I think session id is still useful. For example, SQL Client can convey the user name/password with the current API. So I am prone to keep it unchanged and prepare for the future authentication mechanism.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I got it.

@fsk119
Copy link
Member Author

fsk119 commented Jan 9, 2023

@flinkbot run azure

@fsk119 fsk119 force-pushed the rm-id branch 2 times, most recently from 05d32c2 to 23fba07 Compare January 9, 2023 07:38
Copy link
Contributor

@swuferhong swuferhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@fsk119 fsk119 merged commit d37fca8 into apache:master Jan 9, 2023
@fsk119 fsk119 deleted the rm-id branch January 29, 2023 01:55
chucheng92 pushed a commit to chucheng92/flink that referenced this pull request Feb 3, 2023
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants