Hi Oscar,

You are correct about the OffsetInitializer being only effective when there
is no Flink state--in addition, if you have partition discovery on, this
initializer will be reused for the new partitions (i.e. splits) discovered.
Assuming the job is continuing from the offset in Flink state, there is no
difference between the two strategies. This is because the
`auto.offset.reset` maps to the `OffsetResetStrategy` and
OffsetInitializer.earliest uses `earliest` too.

Best,
Mason

On Mon, Jul 3, 2023 at 6:56 AM Oscar Perez via user <user@flink.apache.org>
wrote:

> Hei,
>
> Looking at the flink documentation for kafkasource I see the following
> values for starting offset:
>
> OffsetInitializer.earliest
> OffsetInitializer.latest
> OffsetInitializer.commitedOffset(OffsetResetStrategy.EARLIEST)
>
> From what I understand OffsetInitializer.earliest uses earliest offset the
> first time but later deployments will use the committed offset in the flink
> state to resume from there. If that is the case what is the difference
> between OffsetInitializer.earliest and
> commitedOffset(OffsetResetStrategy.EARLIEST) if both continue from the
> committed offset after redeployment?
>
> Thanks!
> Oscar
>

Reply via email to