DanielLeens commented on PR #13697: URL: https://github.com/apache/seatunnel/pull/13697#issuecomment-7246575685
## Implementation Notes and Trade-offs Head: `f4544c309dc421484f3be7406dc1360b22cd2d78`. Fixes #13693. **Problem and execution path.** `DorisSinkWriter` composes the configured prefix, target table path, job/subtask and the existing source discriminator. `LabelGenerator` then adds the checkpoint id or timestamp/sequence. With long valid ASCII names the resulting label can exceed Doris's default128 limit after a successful small run. The additional discriminator/sequence from #13111 is necessary and remains intact. **Chosen boundary.** Bound the complete active prefix once in the deepest writer constructor, before constructing its generator and before persisting new state. Prefixes fitting the107/92 budgets remain unchanged. Longer prefixes retain a readable beginning plus SHA-256 of the complete generated prefix, including its existing source discriminator. The existing shaded Guava provides the hash; no dependency or POM change. Hashing runs once per writer rather than per row or batch. Inputs outside the standard ASCII label alphabet retain their previous path; custom server limits are not discovered. **Recovery.** The restored prefix is deliberately kept raw. Initial2PC cleanup aborts that exact legacy identity and, when different, also aborts the active identity. This second cleanup matters if an upgrade attempt pre-committed the new label but failed before its first new checkpoint: restoring the same old checkpoint must clean that new orphan too. Equal prefixes make one abort call; either cleanup failure prevents a new load. The common initialization path covers frontend-routed and direct-to-BE operation. `DorisSinkState` bytes/UID, checkpoint suffixes and the global non2PC sequence are unchanged. **Alternatives considered.** Shortening user database/table names is a workaround rather than repairing valid migrations. Truncating the final label can remove checkpoint or sequence uniqueness. Normalizing only inside `LabelGenerator` would leave persisted/abort prefixes inconsistent with emitted labels. Hashing every prefix would unnecessarily change short-label identities. This implementation changes only over-budget standard ASCII prefixes and keeps their digest stable across retries. Shutdown behavior remains with open #10060; it is not duplicated here. **Validation and limits.** The affected reactor passed835 tests with zero failures/errors/skips; all three new regressions fail against the unchanged baseline writer. Existing full-value IT assertions remain, with long-prefix configurations and single-row non2PC batches; the complete current IT/common sources compiled for Java8. On a real isolated Doris2.1.11-rc01 fixture,45 non2PC rows/Unicode values matched exactly. The native API recovery probe seeded an old precommit, restored checkpoint7, created a new-prefix orphan at8, restored7 again, confirmed both cleanup paths, committed the replacement, then restored new state and committed9. Final queries returned exactly the two committed rows, excluding orphan rows. Candidate JAR/class provenance, private-destination and capacity checks passed. This was direct native connector validation, not the complete Zeta/Flink/Spark Testcontainers lifecycle. The PR addresses correctness; full-engine DataX superiority is not claimed. The initial fork CI snapshot was queued, so it supplies no CI-pass or merge-readiness conclusion. -- 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]
