Skip to content

[WIP][KYUUBI #3723]Add SQL session state management and save metadata #7143

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

z1131392774
Copy link
Contributor

  • Add a new SessionState enum to define possible session states.
  • Insert or update metadata at different stages of the session lifecycle.

Why are the changes needed?

#3723

How was this patch tested?

No,it's just a draft.

Was this patch authored or co-authored using generative AI tooling?

No.

- Add a new SessionState enum to define possible session states.
- Insert or update metadata at different stages of the session lifecycle.
@z1131392774
Copy link
Contributor Author

Hi @turboFei and other maintainers,

I've just submitted this as a Draft PR for some early feedback. Could you please take a look at the general approach and let me know if there are any initial suggestions? Thanks!

@@ -73,6 +77,39 @@ class KyuubiSessionImpl(
case (key, value) => sessionConf.set(key, value)
}

val (clusterManager, kubernetesInfo) = engine.engineType match {
Copy link
Member

Choose a reason for hiding this comment

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

it is not accurate here

Copy link
Member

@turboFei turboFei Jul 20, 2025

Choose a reason for hiding this comment

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

For the clusterManager, I think you can leave it empty and update it after getting the engine info.

But seems it does not matter.

Copy link
Member

@turboFei turboFei Jul 20, 2025

Choose a reason for hiding this comment

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

FYI:

val appMgrInfo =
engineNode.attributes.get(KyuubiReservedKeys.KYUUBI_ENGINE_APP_MGR_INFO_KEY)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks for the guidance! I will get this updated.

SessionState.validateTransition(state, newState)
newState match {
case SessionState.RUNNING =>
info(s"Session is ready.")
Copy link
Member

Choose a reason for hiding this comment

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

this kind of log is meaningless without session identifier

case SessionState.RUNNING =>
info(s"Session is ready.")
case SessionState.ERROR | SessionState.TIMEOUT | SessionState.CLOSED =>
info(s"Session is terminated.")
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Member

Choose a reason for hiding this comment

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

and please log the state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants