[SPARK-58097][CONNECT] Preserve composite (userId, sessionId) session identity in Connect UI/status store#57219
Open
venkata91 wants to merge 1 commit into
Open
Conversation
1c8b97e to
2aefcd4
Compare
… identity in Connect UI/status store ### What changes were proposed in this pull request? Spark Connect identifies a session by the composite `(userId, sessionId)` and two different users may legally share the same session UUID. The Connect UI status listener and store, however, keyed sessions by `sessionId` alone, so such sessions collapsed into a single record: their execution counts merged and whichever user closed first finished/removed the shared row while the other session was still valid. History Server replay reproduced the same result. This keys `SessionInfo` (its KVStore natural key) and the listener's live-session tracking by the composite `(userId, sessionId)`, via a synthesized `uniqueId`. The UI session page and its links now carry `userId` in addition to the session id so a single session can be looked up unambiguously. ### Why are the changes needed? Two users sharing a session UUID are distinct sessions in Spark Connect (see `SparkConnectServiceE2ESuite`), but the UI/status store merged them, showing incorrect execution counts and lifecycle state. Surfaced during review of SPARK-57941. ### Does this PR introduce _any_ user-facing change? The Connect session detail UI page now requires a `userId` request parameter in addition to `id`; the links that reach it are updated accordingly. Existing History Server disk stores written with the old `sessionId`-only key are not found by the new composite lookup (the detail page shows no info until the store is regenerated); no store version bump is done. ### How was this patch tested? Added same-UUID/different-user coverage (live and History Server replay) in `SparkConnectServerListenerSuite`, updated `SparkConnectServerPageSuite` for the new parameter. `build/sbt 'connect/testOnly org.apache.spark.sql.connect.ui.*'` passes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8)
2aefcd4 to
f4a0db4
Compare
Contributor
Author
|
cc @sunchao for review — this is the SPARK-58097 follow-up we discussed on #57016 (composite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Spark Connect identifies a session by
(userId, sessionId), and two users may share the same session UUID. The Connect UI listener/store keyed sessions bysessionIdalone, so such sessions collapsed into one record (merged execution counts; one user's close finished/removed the other's row). History Server replay reproduced the same.This keys
SessionInfo's KVStore natural key and the listener's live-session map by a synthesized compositeuniqueId = userId/sessionId. The UI session page and its links now passuserIdalongside the session id.Why are the changes needed?
Two users sharing a session UUID are distinct sessions in Spark Connect (see
SparkConnectServiceE2ESuite), but the UI/status store merged them, showing incorrect counts and lifecycle state. Surfaced during review of SPARK-57941.Does this PR introduce any user-facing change?
The Connect session detail page now requires a
userIdrequest parameter in addition toid. Existing History Server disk stores written with the oldsessionId-only key won't be found by the new lookup (detail page shows no info until regenerated); no store version bump.How was this patch tested?
Added same-UUID/different-user coverage (live + History Server replay) in
SparkConnectServerListenerSuite; updatedSparkConnectServerPageSuite.connect/testOnly org.apache.spark.sql.connect.ui.*passes (11 tests).Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)