Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][KafkaSource]Fix the default value of commit_on_checkpoint. #3831

Merged
merged 3 commits into from
Dec 30, 2022

Conversation

lightzhao
Copy link
Contributor

@lightzhao lightzhao commented Dec 29, 2022

Fix the default value of commit_on_checkpoint,it is different from the default value described in the document, and the modification is consistent.
image
image

Purpose of this pull request

Check list

EricJoy2048
EricJoy2048 previously approved these changes Dec 29, 2022
@@ -38,7 +38,7 @@ public class ConsumerMetadata implements Serializable {
private String bootstrapServers;
private Properties properties;
private String consumerGroup;
private boolean commitOnCheckpoint = false;
private boolean commitOnCheckpoint = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value need get from the COMMIT_ON_CHECKPOINT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is from the parameter 'commit_on_checkpoint', but if the user does not set it, the default value of CommitOnCheckpoint of ConsumerMetadata will be taken, and its default value is false.
image
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use COMMIT_ON_CHECKPOINT to define the default value.

    public static final Option<Boolean> COMMIT_ON_CHECKPOINT = Options.key("commit_on_checkpoint")
            .booleanType()
            .defaultValue(true)
            .withDescription("If true the consumer's offset will be periodically committed in the background.");

So, I think if user does not set it in config file, you need get the default value from COMMIT_ON_CHECKPOINT.defaultValue(). Otherwise, the defaultValue in Option will lose its meaning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, you're right. It's been changed.

ashulin
ashulin previously approved these changes Dec 29, 2022
@EricJoy2048 EricJoy2048 self-requested a review December 30, 2022 03:28
@EricJoy2048 EricJoy2048 dismissed their stale review December 30, 2022 03:29

need update code

@EricJoy2048
Copy link
Member

LGTM

Copy link
Contributor

@TaoZex TaoZex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lightzhao
Copy link
Contributor Author

@EricJoy2048 please merge, thanks.

Copy link
Contributor

@ic4y ic4y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@ic4y ic4y merged commit df96984 into apache:dev Dec 30, 2022
@lightzhao lightzhao deleted the kafka-commit_on_checkpoint branch December 30, 2022 09:10
lhyundeadsoul pushed a commit to lhyundeadsoul/incubator-seatunnel that referenced this pull request Jan 3, 2023
lhyundeadsoul pushed a commit to lhyundeadsoul/incubator-seatunnel that referenced this pull request Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants