Repository navigation
Conversation
2a5a535 to
bb0f4fe
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
The primary fix has end-to-end value. All 27 Core tag tests and four existing Flink 1.20.1 watermark tests passed locally. An additional Flink SQL case confirmed that the default writer rejects the invalid first watermark before publishing a snapshot and creates the expected tag on the next valid write. Two supported configurations still reproduce the poisoned watermark in Flink SQL.
6cd7c55 to
42eeb06
Compare
|
@JingsongLi CI is green and comments are addressed. Another look when you have a chance? Thanks! |
JingsongLi
left a comment
There was a problem hiding this comment.
The two previous cases pass on this revision. All 46 cases in TagAutoManagerTest and TagPeriodHandlerTest passed locally.
9ceffaf to
5aeb6fa
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
The revised head passed 51 Core tag tests and four Flink end-input watermark tests, including the two previously reported restored-boundary and first-usable-watermark cases. I found one remaining write-only configuration where the validator accepts a snapshot the separate tag maintainer cannot process.
a16f7b1 to
3f7fc7d
Compare
|
This PR is limited to validating new or advancing watermarks before snapshot publication. With watermark-based automatic tags enabled, the writer rejects a value that could produce an unformattable tag year and asks for epoch milliseconds. This fix stands on its own because it prevents later writes from inheriting a bad watermark and addresses reported cases. Changes to tag creation, expiration, retention, and restart recovery belong in separate PRs, including exact recovery of custom periods to the second or higher precision (Without that scope boundary, interactions among these features would bring many additional concerns into the review and leave the PR without a clear completion criterion.). If you have time, PTAL, thanks! |
a388232 to
129e39b
Compare
…lishing snapshots
129e39b to
c1afc41
Compare
Fixes #11301.
Purpose
With
tag.automatic-creation=watermark, a Flink batch write can publish a snapshot before tag creation fails. For example, passing epoch microseconds toend-input.watermarkcan produce an hourly tag in year 56664. Later writes inherit that watermark even when they supply the correct millisecond value.When a write first sets or advances the watermark, the Java commit path rejects it before publishing the snapshot if it could produce a tag whose year cannot be formatted. The error message asks for epoch milliseconds. The first tag for that watermark must have a four-digit year under the configured period and time zone, even if an existing tag would let a running maintainer apply its creation delay. With automatic completion enabled, the latest tag that could be due after the delay must also fit. The check covers write-only writers with a separate tag maintainer. The Flink option description also specifies epoch milliseconds.
Scope
This PR covers the decision to publish a snapshot and documents the unit of Flink's
end-input.watermarkoption. Changes to manual tag operations (create, rename, replace, or delete), automatic tag creation and backfilling, retention and expiration policies, and recovery after a restart belong in separate PRs.For example, accepting a watermark because an existing tag makes the delayed boundary printable would require the writer to know which tags and snapshots will survive until a separate maintainer runs. That would couple snapshot publication to retention and recovery. Likewise, resuming a custom period at the exact second or fraction of a second after a restart would require storing progress more precisely than the minute recorded in the tag name.
Tests
Two core regression tests cover recovery on the next valid write and the completion boundary for a write-only writer with a separate maintainer. With Flink 1.20.3 batch SQL, the rejected input
1726000000000000left the table without a snapshot. The next input,1726003600000, created snapshot 1 and the UTC hourly tag2024-09-10 20.