Open vontman opened 2 months ago
Hello @vontman, Thanks for finding the time to report the issue! We really appreciate the community's efforts to improve Apache Kyuubi.
this is by design, and is one of the known limitations of sharable spark engine. we provide some configurations to mitigate that in special cases, for example,
kyuubi.session.conf.ignore.list
- A comma-separated list of ignored keys. If the client connection contains any of them, the key and the corresponding value will be removed silently during engine bootstrap and connection setup. Note that this rule is for server-side protection defined via administrators to prevent some essential configs from tampering but will not forbid users to set dynamic configurations via SET syntax.
kyuubi.session.conf.restrict.list
- A comma-separated list of restricted keys. If the client connection contains any of them, the connection will be rejected explicitly during engine bootstrap and connection setup. Note that this rule is for server-side protection defined via administrators to prevent some essential configs from tampering but will not forbid users to set dynamic configurations via SET syntax.
@pan3793 Thanks for the quick reply!
May I ask why it is designed like this? Why we might need to append the session properties to the engine submission?
For the configuration kyuubi.session.conf.ignore.list
, the ignored keys will not be set at all in the connection? or they will be ignored just for the bootstrap?
specific to spark engine, there is a concept "static configuration" which means it can only be set on spark app bootstrap, e.g. driver/executor cores/memory size, a typical use case is:
beeline -u "jdbc:kyuubi://kyuubi:10009/db1#kyuubi.engine.share.level=CONNECTION;spark.driver.memory=4g;spark.executor.memory=8g" -f batch-sql-1.sql
beeline -u "jdbc:kyuubi://kyuubi:10009/db2#kyuubi.engine.share.level=CONNECTION;spark.driver.memory=2g;spark.executor.memory=4g" -f batch-sql-2.sql
if kyuubi.session.conf.ignore.list
is configured, the listed keys will be removed in both engine bootstrap and session context.
@pan3793 Many thanks for the information 🙏
I am afraid these configurations will not be of much help in our case 😅 But they are good to have for protection 👌
@vontman I removed the "bug" label as it is not, and you are always welcome to contribute ideas/patches to improve that :)
Code of Conduct
Search before asking
Describe the bug
How to reproduce
Using kyuubi + spark + hive
On opening the first connection (where the spark SQL engine is submitted) with session properties like
jdbc:hive2://localhost:10009/?spark.abc=123
If we execute
SET spark.abc;
in that connection we correctly get123
On opening any other connection afterwards without any session properties like
jdbc:hive2://localhost:10009
If we execute
SET spark.abc;
we get123
, although we haven't set this session property for this connection.Initial Analysis
On opening the first connection, Kyuubi submits a spark application for SQL Engine
On looking at the submission parameters, it looks like Kyuubi includes the sessions configs in the spark configs
By debugging Kyuubi code, it looks like the session configs are added to the configs in starting the engine in getOrCreate!
Affects Version(s)
1.7.1,1.9.2
Kyuubi Server Log Output
Kyuubi Engine Log Output
No response
Kyuubi Server Configurations
Kyuubi Engine Configurations
No response
Additional context
No response
Are you willing to submit PR?