KAFKA-2390-followup; add unit test for OffsetOutOfRange exception#239
KAFKA-2390-followup; add unit test for OffsetOutOfRange exception#239lindong28 wants to merge 5 commits into
Conversation
|
kafka-trunk-git-pr #532 FAILURE |
|
@lindong28 Why not include this test in FetcherTest? Also, do you think it's worthwhile adding a test case which checks that the out of range error is ignored when the user seeks to a different offset? |
|
@hachikuji I couldn't include this test in FetcherTest, because to test OffsetOutOfRange exception the defaultResetPolicy needs to be NONE. But the defaultResetPolicy can't be changed after setup. Sure, let me add another test to check that the out of range error is ignored when the user seeks to a different offset. |
|
kafka-trunk-git-pr #533 SUCCESS |
|
@lindong28 Not sure that problem calls for a new class. An easy way would be to create a factory method in FetcherTest which each test uses to construct a new Fetcher instance. Up to you, but it's nice to keep related tests organized together. |
|
kafka-trunk-git-pr #534 FAILURE |
|
@hachikuji I agree that nice to keep related tests organized together. I can implement that factory class to be used across test cases. Another alternative is to add method setOffsetResetStrategy() in class SubscriptionState. That looks OK to me and would make things much easier here. What do you think? |
|
@hachikuji I have moved the test cases to FetcherTest. Please let me know if it looks good. Thank you. |
There was a problem hiding this comment.
Might be no need to make this a field since it's only used in two test cases.
There was a problem hiding this comment.
Sounds OK to me since it is used more than once.
|
@lindong28 One minor comment. Overall, LGTM. |
|
kafka-trunk-git-pr #537 SUCCESS |
|
Thanks @hachikuji @guozhangwang for your quick review. |
As we are stopping brokers in these tests, there is a timing issue where the TierTopicManager doesn't manage to create the tier topic and doesn't become ready in time to archive the segments we produce. By the time it tries to create the tier topic, there are not enough brokers for the replication factor, meaning that all tiering is blocked. Also improve logging when tier topic creation fails.
…o initialize zkUtils. (apache#239) - Fix executor state being stuck in EXECUTION_STARTED due to failures to initialize zkUtils. - Use a single zkUtils within the Executor.
…c storage. (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
…c storage. (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
…c storage (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
…c storage (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
…c storage (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
…c storage (apache#239) Kafka JIRA: KAFKA-9555 Source commit: satishd/kafka@25f9120 Summary: - Introduced TopicBasedRemoteLogMetadataManagerHarness which takes care of bringing up a Kafka cluster and create remote log metadata topic and initializes TopicBasedRemoteLogMetadataManager. - Added TopicBasedRemoteLogMetadataManager to run the existing tests by making the existing RemoteLogMetadataManagerTest parameterized. - Added transformation of TopicIdPartition into bytes with custom hashing. - Skipping the events which are not currently assigned for the ConsumerTask. Added file based remote log metadata snapshots: - Added TopicBasedRemoteLogMetadataManagerRestartTest and fixed issues in reloading the snapshots. - TopicBasedRemoteLogMetadataManagerRestartTest is about verifying: * load the earlier saved snapshots after restart * check the entries are available * start the consumer and add more metadata entries * check the newly addded entries and loaded entries are available - Fixed a few issues in snapshot read/write/load and added tests. This is part of tiered storage KIP-405 efforts. Co-authored-by: Satish Duggana <satishd@apache.org>
No description provided.