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

(trunk) KAFKA-5232 Fix Log.parseTopicPartitionName to take into account dot character in topic names of deleted topics #3050

Closed
wants to merge 3 commits into from

Conversation

jaikiran
Copy link
Member

The commit here contains a fix and a test case for the issue reported in https://issues.apache.org/jira/browse/KAFKA-5232. This PR is meant for trunk branch and a corresponding PR for 0.10.2 branch has been raised here #3043

Copy link
Contributor

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Left a few suggestions when it comes to the tests.

@@ -1640,6 +1640,18 @@ class LogTest {
assertEquals(partition.toInt, topicPartition.partition)
}

// see https://issues.apache.org/jira/browse/KAFKA-5232
Copy link
Contributor

Choose a reason for hiding this comment

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

This is simple enough that we can write a short description here instead of referencing the JIRA.

@@ -1640,6 +1640,18 @@ class LogTest {
assertEquals(partition.toInt, topicPartition.partition)
}

// see https://issues.apache.org/jira/browse/KAFKA-5232
@Test
def testParseTopicPartitionNameForDeletedTopic() {
Copy link
Contributor

Choose a reason for hiding this comment

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

testParseTopicPartitionNameWithPeriodForDeletedTopic?

val topicPartition = Log.parseTopicPartitionName(dir)
assertEquals("Unexpected topic name parsed", topic, topicPartition.topic)
assertEquals("Unexpected partition number parsed", partition.toInt, topicPartition.partition)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're doing this, it would be better to flesh out tests for the deleted case. Namely variants of testParseTopicPartitionNameForMissingSeparator, testParseTopicPartitionNameForMissingTopic and testParseTopicPartitionNameForMissingPartition with the -delete suffix.

@asfbot
Copy link

asfbot commented May 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/3891/
Test FAILed (JDK 7 and Scala 2.11).

…aking into account the potential presence of '.' character in topic names while looking for topics that are marked for deletion
@jaikiran
Copy link
Member Author

@ijuma, thanks for reviewing. I have updated this PR to take into account your review comments. I updated those existing test methods to include checks for the -delete variant, instead of creating separate test methods for each of those existing ones. However, I am open to create new test methods for them, if you think that's a better idea.

@asfbot
Copy link

asfbot commented May 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/3893/
Test FAILed (JDK 7 and Scala 2.11).

@ijuma
Copy link
Contributor

ijuma commented May 14, 2017

@jaikiran, I did a PR to your branch with additional improvements: https://github.com/jaikiran/kafka/pull/1

Please merge if they look good to you.

@asfbot
Copy link

asfbot commented May 14, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3882/
Test PASSed (JDK 8 and Scala 2.12).

Various improvements to `parseTopicPartitionName` and tests
@jaikiran
Copy link
Member Author

Done. Those changes looked good to me.

@asfbot
Copy link

asfbot commented May 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/3907/
Test FAILed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 15, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3896/
Test PASSed (JDK 8 and Scala 2.12).

@asfgit asfgit closed this in f56bbb6 May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants