smiralexan commented on issue #20808:
URL: https://github.com/apache/hudi/issues/20808#issuecomment-7117217564
Thanks for reproducing it, @cshuo!
Agreed on both rejected alternatives. My concern is that an optional
`uid-suffix` on top of the current default does not prevent the problem:
- A job that never sets the suffix still gets counter-based uids, and
nothing looks wrong until the first resubmit from the same JVM, when the
savepoint is already taken. The workaround is easy once the cause is known
(submit from a fresh JVM: `flink run`, a restarted SQL client), but the restore
error does not point to it.
- The counter was added in #9680 for one table used twice in a job. That
case is rare, while the side effect hits any job resubmitted from the same JVM
(JobManager REST API or web UI, a `sql-client` session).
I would turn it around: `uid_<operator>_<db.table>` with no counter by
default, and `uid-suffix` only for a table used twice, where Flink fails at
graph build until one usage gets a suffix. Iceberg works this way
(apache/iceberg#14063):
```sql
INSERT INTO t /*+ OPTIONS('uid-suffix'='source1') */ SELECT id, data FROM
sourceTable;
INSERT INTO t /*+ OPTIONS('uid-suffix'='source2') */ SELECT id, data FROM
sourceTable1;
```
The failure moves from restore time to submit time and affects far fewer
jobs. It is a compatibility change, so it needs a major release and a switch
that keeps the counter for existing savepoints; until then, a note in the docs
would make the cause findable.
BTW, there is also `ProviderContext.generateUid` for Flink SQL: the planner
gives the connector a uid derived from the plan node, so two scans of one table
get different uids without any suffix. By default it returns a uid only for
jobs created from a compiled plan (`COMPILE PLAN` / `EXECUTE PLAN`), so
unfortunately it is not a general solution, but it could be useful there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]