Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/4344#discussion_r127935505
--- Diff:
flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBaseTest.java
---
@@ -532,6 +533,107 @@ public void
testSnapshotStateWithCommitOnCheckpointsDisabled() throws Exception
verify(fetcher,
never()).commitInternalOffsetsToKafka(anyMap()); // not offsets should be
committed
}
+ @Test
+ public void testRestoredStateInsensitiveToMissingPartitions() throws
Exception {
+ List<KafkaTopicPartition> mockFetchedPartitionsOnStartup =
Arrays.asList(
+ new KafkaTopicPartition("test-topic", 0),
+ new KafkaTopicPartition("test-topic", 1),
+ new KafkaTopicPartition("test-topic", 2));
+
+ // missing fetched partitions on restore
+ List<KafkaTopicPartition> mockFetchedPartitionsOnRestore =
mockFetchedPartitionsOnStartup.subList(0, 2);
+
+
testRestoredStateInsensitiveToFetchedPartitions(mockFetchedPartitionsOnStartup,
mockFetchedPartitionsOnRestore);
+ }
+
+ @Test
+ public void testRestoredStateInsensitiveToNewPartitions() throws
Exception {
+ List<KafkaTopicPartition> mockFetchedPartitionsOnStartup =
Arrays.asList(
+ new KafkaTopicPartition("test-topic", 0),
+ new KafkaTopicPartition("test-topic", 1),
+ new KafkaTopicPartition("test-topic", 2));
+
+ // new partitions on restore
+ List<KafkaTopicPartition> mockFetchedPartitionsOnRestore = new
ArrayList<>(mockFetchedPartitionsOnStartup);
--- End diff --
will change ð
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---