Hi All! I have a question regarding savepoints in ...
# troubleshooting
r
Hi All! I have a question regarding savepoints in flink SQL. Is there a way to identify a SQL clause as an operator? So that if I recover from a savepoint, that query runs from that point on?
m
I'm not sure I understand your use case, but you can already start a SQL job from your savepoint. See https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sqlclient/#start-a-sql-job-from-a-savepoint
r
I get that bit, when I did though, I got:
Copy code
java.lang.IllegalStateException: Failed to rollback to checkpoint/savepoint <s3://flink-checkpoints-prod-us/savepoints/savepoint-f24148-365a16502fb2>. Cannot map checkpoint/savepoint state for operator 81b0d5817065b956d863390ee24c34a0 to the new program, because the operator is not available in the new program. If you want to allow to skip this, you can set the --allowNonRestoredState option on the CLI.
Which I believe was due t modifying the query. However, in my case I know that it'd be safe to recover specific SQL statements, within the statement set. Now, as I understand it, in SQL, the operator ID's are generated. My question was, if there was a way to 'point' a query to an operator, so that it'd recover from that point?
m
Yes, query modifications can result in an incompatible plan. Upgrades from those are currently not supported
r
Thanks, is there a recommended pattern / workaround for upgrading, or just destroy and replay?
m
Currently it's destroy and replay. I could envision that at some point patterns from FLIP-190 https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=191336489 could be extended to support these breaking changes, but that's just an idea in my head
r
Thanks again, much apprecaited!
a
In a scenario like this, how would the
allowNonRestoredState
param work? Would it just skip the checkpoint/savepoint altogether? Or would it try to salvage some parts of checkpoint such as where to begin processing data from the stream?
m
It won’t work because you can’t specify it in a Flink SQL client
a
I see, how would it work for the normal flink client (cli client)? E.g., If we run a job (submit a jar) with an updated SQL query and add the
allowNonRestoredState
param, would it just ignore the last checkpoint/savepoint?
m
You mean from a Table API application JAR where you use SQL?
a
yep
m
Probably wouldn’t work. That option is designed for removing an operator from a plan, not for changing an operator
But not 100% sure