-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-33259][SS] Disable streaming query with possible correctness issue by default #30210
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
|
Thank you so much, @viirya ! |
|
I'd rather try to get some sort of consensus via initiating the discussion around dev@ mailing list. I see Spark community does everything in the PR (even that requires some sort of consensus) which I don't think it's ideal and the result is from consensus among the narrow group. To explain why I made it just logging instead of failing the query - I tried to get consensus around how to deal with this before:
I failed to get any voice except @gaborgsomogyi in #24890 and the approach wasn't radical so I did it. This change may break some query which may work if end users are super careful and know in details and go ahead. (there's new config for sure though) I don't expect majority of end users could be, but just hypothetically thinking. I'm OK to disable such query, but I'm not 100% sure everyone is on the same page. (Someone might concern and you'd better to check that.) |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
This comment has been minimized.
This comment has been minimized.
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #130483 has finished for PR 30210 at commit
|
|
cc @dbtsai , @gatorsmile since this is a correctness issue. |
|
I think it's ok to change the original param to a SQL config for end users. +1 for this concern. So how about change the default value to Actually, I reviewed that PR after merging 😂, thanks for the excellent doc! |
I believe this is not the first change that may break some queries. We did some similar. For such changes, we provided some configs so users still can keep with legacy behavior if they want. This change basically follows this approach. This involves correctness and may not be aware by users. Users need to be very careful to avoid the issue. I think we should provide a baseline which is definitely correct, and provide an option (the config) for users to run with correctness risk.
For outer join or aggregation, I think the risk of correctness is pretty high. |
|
No I don't have real case for knowing and taking the risk. Probably I could create some query which could evade the issue, but I agree that's more likely in theory and not real case. Saying again I don't object the change. If you look back my proposal then you'll find blocking the query is also one of options in my proposal. My point was that such change warrants the discussion, ideally in dev@ mailing list instead of PR. We should avoid making an important decision in closed group. |
|
Hmm, based on what I saw, it seems to me the discussion on dev@ mailing list is not so active, and the PR attracts more discussion in Spark community, but I'm okay to drop some words in dev@ mailing list and see if we can get some feedback. |
|
That's the chicken and egg problem, you know. dev@ list is not so active because all the important discussions aren't passing through the dev list, which is I think bad in perspective of "community over code". And only me and @xuanyuanking responded for the approach which is more likely just a regular SS PRs. |
| buildConf("spark.sql.streaming.statefulOperator.correctnessCheck") | ||
| .internal() | ||
| .doc("When true, the stateful operators for streaming query will be checked for possible " + | ||
| "correctness issue. Once the issue is detected, Spark will throw analysis exception. " + |
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.
this should have more information about the correctness issue or point to somewhere that does so users can properly make a decision.
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.
Added more info. Thanks.
|
Retest this please |
|
cc @tdas , @zsxwing , @cloud-fan , @gatorsmile |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #130891 has finished for PR 30210 at commit
|
|
Test build #130896 has finished for PR 30210 at commit
|
|
Shall we finalize and merge this PR by address @HeartSaVioR 's comments, @viirya ? |
Let's make sure this review comment is also addressed as well. I just skipped mentioning it as it's already commented. |
Yeah, I will address these comments. |
| val STATEFUL_OPERATOR_CORRECTNESS_CHECK_ENABLED = | ||
| buildConf("spark.sql.streaming.statefulOperator.correctnessCheck") | ||
| val STATEFUL_OPERATOR_CHECK_CORRECTNESS_ENABLED = | ||
| buildConf("spark.sql.streaming.statefulOperator.checkCorrectness.enabled") |
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.
For the naming, cc @cloud-fan .
|
Kubernetes integration test starting |
This comment has been minimized.
This comment has been minimized.
|
Kubernetes integration test status success |
tgravescs
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.
I'm not super picky on the config name, we were trying to get rid of extra .xxx. and nothing else uses .statefulOperator. but changing to combine with checkCorrectness seems very long so seems fine to me
|
retest this please |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #131014 has finished for PR 30210 at commit
|
dongjoon-hyun
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.
+1, LGTM. Thank you, @viirya and all!
Merged to master for Apache Spark 3.1.
|
Sorry to all for all noises. Please disregard all conversation. I'll remove them now. |
|
I just initiated the discussion on dev@ mailing list which I should have been done instead. My apologize to make noises and feel anyone unhappy. |
What changes were proposed in this pull request?
This patch proposes to disable the streaming query with possible correctness issue in chained stateful operators. The behavior can be controlled by a SQL config, so if users understand the risk and still want to run the query, they can disable the check.
Why are the changes needed?
The possible correctness in chained stateful operators in streaming query is not straightforward for users. From users perspective, it will be considered as a Spark bug. It is also possible the worse case, users are not aware of the correctness issue and use wrong results.
A better approach should be to disable such queries and let users choose to run the query if they understand there is such risk, instead of implicitly running the query and let users to find out correctness issue by themselves and report this known to Spark community.
Does this PR introduce any user-facing change?
Yes. Streaming query with possible correctness issue will be blocked to run, except for users explicitly disable the SQL config.
How was this patch tested?
Unit test.