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

[FLINK-36780] Kafka source disables partition discovery unexpectedly #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liuml07
Copy link
Member

@liuml07 liuml07 commented Nov 23, 2024

Currently Kafka source enables partition discovery. This is set by partition.discovery.interval.ms, aka KafkaSourceOptions.PARTITION_DISCOVERY_INTERVAL_MS. The default value is 5 minutes, which is equal to the default value of metadata.max.age.ms in Kafka.

However, it's disabled by default unexpectedly in the source builder (code). The intention I believe was to only disable for bounded source.

We need a fix that is able to keep the default partition discovery. This could cause data loss after Kafka retention if the new partitions are not consumed silently.

Copy link

boring-cyborg bot commented Nov 23, 2024

Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)

@@ -217,6 +217,29 @@ public void testSettingInvalidCustomDeserializers(
.hasMessageContaining(expectedError);
}

@Test
public void testDefaultPartitionDiscovery() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test fails without the fix, and passes now with the fix.

}

@Test
public void testPeriodPartitionDiscovery() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This newly added test is to avoid regressions for bounded source.

@liuml07 liuml07 changed the title [FLINK-36780] Kafka source disable partition discovery unexpectedly [FLINK-36780] Kafka source disables partition discovery unexpectedly Nov 23, 2024
Copy link
Contributor

@pnowojski pnowojski left a comment

Choose a reason for hiding this comment

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

I think the change looks good to me. It would be good to have some feedback from someone more familiar with the Kafka Source. If that doesn't happen within a couple of days, I would propose to just go ahead and merge it.

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.

2 participants