-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-55280][CONNECT] Add GetStatus proto to support execution status monitoring #54062
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
Conversation
JIRA Issue Information=== New Feature SPARK-55280 === This comment was automatically generated by GitHub Actions |
| optional string client_observed_server_side_session_id = 4; | ||
|
|
||
| // The type of status being requested. | ||
| // Implies mutually exlusive status types, e.g. session-level, operation-level, other custom |
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.
Nit: Typo
| // Implies mutually exlusive status types, e.g. session-level, operation-level, other custom | |
| // Implies mutually exclusive status types, e.g. session-level, operation-level, other custom |
| OPERATION_STATE_UNKNOWN = 1; | ||
| OPERATION_STATE_RUNNING = 2; | ||
| OPERATION_STATE_TERMINATING = 3; | ||
| OPERATION_STATE_TERMINATED = 4; |
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.
Should we also include cause of termination? (Successfull/Failed/Cancelled)
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.
With abandoned operations counted as cancelled? Sounds good, will add.
We would need to introduce tracking of the termination reason for closed operations.
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.
Done.
| // The type of status being requested. | ||
| // Implies mutually exlusive status types, e.g. session-level, operation-level, other custom | ||
| // stats. | ||
| oneof status_type { |
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've been thinking about this and I'm conlficted between a top-level oneof here vs a hybrid:
repeated StatusTypeRequest status_types = ...
message StatusTypeRequest {
oneof status_type {
...
}
}The top-level oneof is simple and follows the principle of YAGNI but with the context of this RPC being used for monitoring/polling, serving multiple status types in a single round-trip would help avoid complexity on the client side where it may need to look at several different points of information to proceed.
@hvanhovell WDYT?
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.
The worst thing that can happen if we make it top-lvl is if request infos are overlapping, and we return inconsistent data in two response types because of a race. That's also true for two separate oneof requests, but less confusing.
Otherwise, oneof is not strictly needed indeed for read-only requests, as they should not interfere much (other than being inconsistent with each other, affecting response times).
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.
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.
IMHO, there is no need to guarantee consistency by using oneOf to limit the client to reading only one type of data per request. The important thing to consider is how to have the server handle these requests using a consistent snapshot for reading. That said, a hybrid approach is more flexible because it is more expressive and makes it easier to guarantee consistency if the server supports it.
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.
Moved to top level
|
If I understand correctly, simply updating a protobuf file and adding the generated code doesn’t change the behavior, so the answer to 'Does this PR introduce any user-facing change?' should be no? |
Initially, this rpc will provide operations statuses. It's designed to be extensible in two ways: - Requesting different status types (operation-level, session-level, some specific stats). - Requesting different information in each type.
4143a02 to
ab0696d
Compare
hvanhovell
left a comment
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 - merging to master. Thanks!
What changes were proposed in this pull request?
Add GetStatus proto to support execution status monitoring
Initially, this rpc will provide operations statuses. It's designed to be extensible in two ways:
Why are the changes needed?
This API will allow users to monitor status (e.g. RUNNING/TERMINATING/TERMINATED) of the operations in their session. Particularly useful for multiple-thread sessions, where one "monitoring" thread has to know operation statuses from the whole session.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Only proto so far. Handler and tests will be added separately.
Was this patch authored or co-authored using generative AI tooling?
Yes.
Generated-by: Claude 4.5 Opus