-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-51187][SQL][SS] Implement the graceful deprecation of incorrect config introduced in SPARK-49699 #49983
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
…anPruneStreamingSubplan" This reverts commit decb677.
@@ -4115,6 +4115,7 @@ object SQLConf { | |||
.doc("Allow PruneFilters to remove streaming subplans when we encounter a false filter. " + | |||
"This flag is to restore prior buggy behavior for broken pipelines.") | |||
.version("4.0.0") | |||
.withAlternative("spark.databricks.sql.optimizer.pruneFiltersCanPruneStreamingSubplan") |
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.
@dongjoon-hyun
Should we add this to DeprecatedConfig as well? Also, should we also file a JIRA ticket for removing?
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.
It's no harm to add it. When we remove the config in the future (throw an error if it's set), we need a ticket.
// metadata in the offset log may have this if the batch ran from Spark 3.5.4. | ||
// We need to pick the value from the metadata and set it in the new config. | ||
// This also leads the further batches to have a correct config in the offset log. | ||
metadata.conf.get("spark.databricks.sql.optimizer.pruneFiltersCanPruneStreamingSubplan") match { |
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'll add TODO with mentioning removal when we want to file JIRA ticket for removal immediately.
"value of the fixed config") | ||
|
||
val offsetLog = new OffsetSeqLog(spark, new File(dir, "offsets").getCanonicalPath) | ||
def checkConfigFromMetadata(batchId: Long, expectCorrectConfig: Boolean): Unit = { |
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 know this is a bit hard to understand from non-streaming expert folks. Please let me know if you need some further explanation to justify the logic.
I'm going to submit PRs for 4.0/3.5 as well. |
cc. @dongjoon-hyun @HyukjinKwon Please take a look. Thanks! |
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.
Sorry for late response.
I was busy for internal preparing of Spark 4.0.0.
For this one, shall we do this at Apache Spark 3.5.5 while keeping Apache Spark 4.0.0 from from spark.databricks.*
?
If you are busy, I can volunteer the release manager for Apache Spark 3.5.5.
When we release Apache Spark 3.5.5 this month, Apache Spark 4.0.0 can be free of spark.databricks.*
.
WDYT, @HeartSaVioR and @cloud-fan ?
I sent an email for further discussion |
Let me clarify a bit.
Please let me know if you are not on the same page in above, or have any question for this. Thanks! If we are on the same page, I'll remove the config in master/4.0 PR and deprecate the config in 3.5. |
W.r.t. release manager for Spark 3.5.5, either is fine for me. I'm happy to take the step if you prefer to let me take it. |
If we have this grace handling in 3.5.5, we should have it in 4.0.0 as well, otherwise it's a breaking changing in 4.0. |
The migration logic can't be removed anytime soon. I'd say we could only remove it in 4.2 or so (conservatively speaking, 5.0). My all three PRs contain the migration logic. I guess the main point here is when we can stop allowing users to specify the incorrect config by themselves. I have been arguing that users would never set this manually, but I'm open to being conservative on this as well. |
So according to recent discussion, I'm going to remove the withAlternative in this (4.1) and 4.0 PR, but should still need to persist the migration logic for a while. I hope we are on the same page on the necessity of migration logic for a while. |
Technically, we didn't make an agreement on Apache Spark 4.0.0 behavior because there are two alternatives still.
If you don't mind, I'd like to propose to wait until we finish Apache Spark 3.5.5 release. |
I'm really not sure 2 is a realistic alternative. We shouldn't assume users to be very close to hear Spark community news. My experience so far is telling me that users even don't read the doc. Another point for me is that users do not really care about whether the config contains the vendor name or not. This is really a concern from ASF hat on (for sure, I agree this is problematic with one of PMC members in ASF project hat on), but I'm sure it's not a huge concern from users worth upgrading the version. So if we tell users to upgrade the Spark version just because of this problematic config, I'm very sure that they won't upgrade. (We shouldn't also lie to users that there is security concern or so.) We shouldn't pretend that it will be successful if we enforce users to upgrade to specific version. |
have we merged this graceful deprecation in branch 3.5? |
Yes, that is merged. It's still a blocker for Spark 4.0.0 though.
Would you mind explaining why this has to be coupled with Spark 3.5.5, as discussion for 4.1/4.0 can always happen in parallel? I sincerely disagree that the option 2 is viable for us. This builds a huge limitation of SS users for Spark 3.5.4 on upgrading (they have to touch Spark 3.5.x before upgrading to 4.0.0), to achieve our goal of removing the "string" of incorrect config immediately. Again, this is just a string because it's only for migration logic and users won't be able to set the config manually. Why not just be more open for Spark 3.5.4 users to have a range of upgrade path? I'll ensure I remove the migration logic and finally remove the string of the config in certain Spark version, which I prefer to have it in 4.1 or even longer term. If you'd like to hear more voices, I'm happy to post the discussion to dev@. I just don't want this change to be coupled with non-relevant release. |
Yes, please. Thank you, @HeartSaVioR .
|
Thanks, posted to dev@. - https://lists.apache.org/thread/xzk9729lsmo397crdtk14f74g8cyv4sr |
According to the community vote, this becomes stale.
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
What changes were proposed in this pull request?
This PR proposes to implement the graceful deprecation of incorrect config introduced in SPARK-49699.
SPARK-49699 was included in Spark 3.5.4, hence we can't simply rename to fix the issue.
Also, since the incorrect config is logged in offset log in streaming query, the fix isn't just easy like adding withAlternative and done. We need to manually handle the case where offset log contains the incorrect config, and set the value of incorrect config in the offset log into the new config. Once a single microbatch has planned after the restart (hence the above logic is applied), offset log will contain the "new" config and it will no longer refer to the incorrect config.
That said, we can remove the incorrect config in the Spark version which we are confident that there will be no case users will upgrade from Spark 3.5.4 to that version.
Why are the changes needed?
We released an incorrect config and we want to rename it properly. While renaming, we don't also want to have any breakage on the existing streaming query.
Does this PR introduce any user-facing change?
No. That is what this PR is aiming for.
How was this patch tested?
New UT.
Was this patch authored or co-authored using generative AI tooling?
No.