Add Topic and Partition Deletion Functionality to Mock Broker#5350
Open
Ankith L (Ankith-Confluent) wants to merge 3 commits intodev_kip-932_queues-for-kafkafrom
Open
Conversation
- Implement `rd_kafka_mock_topic_delete()` to delete a topic and its partitions. - Implement `rd_kafka_mock_partition_delete_records()` to delete records before a specified offset. - Update command handling in the mock cluster to support new delete operations. - Add tests for topic deletion and partition record deletion to ensure correct behavior. - Introduce max size limit for share groups with appropriate handling in join requests.
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
Member
Kaushik Raina (k-raina)
left a comment
There was a problem hiding this comment.
Thanks for PR! Left couple of comments
| * @brief Create a share consumer connected to mock cluster using the | ||
| * public share consumer API. | ||
| */ | ||
| static rd_kafka_share_t *create_mock_share_consumer(const char *bootstraps, |
There was a problem hiding this comment.
Is new function needed?
| /** | ||
| * @brief Deletes a topic and all its partitions. | ||
| * | ||
| * Subsequent requests referencing the topic will recieve |
Comment on lines
+261
to
+262
| * @return RD_KAFKA_RESP_ERR_NO_ERROR on success | ||
| * RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PARTITION if the topic does not |
There was a problem hiding this comment.
Suggested change
| * @return RD_KAFKA_RESP_ERR_NO_ERROR on success | |
| * RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PARTITION if the topic does not | |
| * @return RD_KAFKA_RESP_ERR_NO_ERROR on success | |
| * RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART if the topic does not |
| /* Consume - expect no data messages since topic is deleted */ | ||
| rkm = rd_kafka_consumer_poll(c, 5000); | ||
| if (rkm) { | ||
| TEST_ASSERT(rkm->err != RD_KAFKA_RESP_ERR_NO_ERROR, |
There was a problem hiding this comment.
Suggested change
| TEST_ASSERT(rkm->err != RD_KAFKA_RESP_ERR_NO_ERROR, | |
| TEST_ASSERT(rkm != NULL && rkm->err != RD_KAFKA_RESP_ERR_NO_ERROR, | |
| "Expected error from deleted topic");R, |
Maybe check rkm?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement rd_kafka_mock_topic_delete() to delete a topic and its partitions.
Implement rd_kafka_mock_partition_delete_records() to delete records before a specified offset.
Add tests for topic deletion and partition record deletion to ensure correct behavior.