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

KAFKA-4476: Kafka Streams gets stuck if metadata is missing #2209

Closed

Conversation

mjsax
Copy link
Member

@mjsax mjsax commented Dec 3, 2016

  • break loop in StreamPartitionAssigner.assign() in case partition metadata is missing
  • fit state transition issue (follow up to KAFKA-3637: Add method that checks if streams are initialised)
  • some test improvements

@mjsax
Copy link
Member Author

mjsax commented Dec 3, 2016

@ijuma
Copy link
Contributor

ijuma commented Dec 3, 2016

Thanks for the PR @mjsax, can you please merge trunk into your branch? It seems like your branch doesn't include 128d0ff for example.

@@ -147,16 +146,22 @@ public void testReprocessingFromScratchAfterResetWithIntermediateUserTopic() thr
60000);
// receive only first values to make sure intermediate user topic is not consumed completely
Copy link
Contributor

Choose a reason for hiding this comment

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

@mjsax is the testNo logic correct in that we only produce when testNo is 1?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. That is intended. Both tests consume the same input topic and different applications IDs, so both can read the same data and thus it's sufficient to write the input only once.

@mjsax mjsax force-pushed the kafka-4476-stuck-on-missing-metadata branch from 7759854 to 9a0d03c Compare December 4, 2016 23:42
@mjsax
Copy link
Member Author

mjsax commented Dec 4, 2016

@ijuma Done.

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 @mjsax. Looks like two tests failed in Jenkins (one of them is testReprocessingFromScratchAfterResetWithIntermediateUserTopic). Is it possible to add tests for the bug fixes that fail reliably instead of transiently?

// => want to test "skip over" unprocessed records
// increasing the sleep time only has disadvantage that test run time is increased
mockTime.sleep(sleep);
sleep *= 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

@dguy
Copy link
Contributor

dguy commented Dec 5, 2016

@mjsax - it is not immediately clear to me what this is fixing? Do you think you can add some unit tests to cover the change? They'll probably help with understanding the issue, too.

@mjsax
Copy link
Member Author

mjsax commented Dec 5, 2016

@ijuma There is another bug...
@dguy Agreed. I had the same thought but wanted to trigger Jenkins build. That's why I opened the PR already.

This is actually tackling two different problems and I did discover a third one. From a bug tracking point of view it would make sense to have different PRs -- however, as all three issue make Reset tool test fails, it's not possible to get a clean build (and be sure there is not fourth one) if we split into multiple PRs... WDYT?

@ijuma
Copy link
Contributor

ijuma commented Dec 5, 2016

@mjsax I think one PR is fine if there are unit tests for each of the issues uncovered.

@mjsax mjsax force-pushed the kafka-4476-stuck-on-missing-metadata branch from 9a0d03c to 2483cdd Compare December 9, 2016 21:38
@mjsax
Copy link
Member Author

mjsax commented Dec 9, 2016

Updated this.

Reactivated ResetToolIntegrationTest. Test might still fail until #2227 and #2233 are merged.

@asfbot
Copy link

asfbot commented Dec 9, 2016

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

@asfbot
Copy link

asfbot commented Dec 9, 2016

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

@asfbot
Copy link

asfbot commented Dec 9, 2016

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

@mjsax mjsax force-pushed the kafka-4476-stuck-on-missing-metadata branch from 2483cdd to 69bb3a7 Compare December 10, 2016 01:01
Copy link
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

a few nit comment, otherwise LGTM.

if (numPartitions == NOT_AVAILABLE) {
continue;
}
if (numPartitions < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: just use (numPartitions == UNKNOWN).

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 could be UNKOWN or NOT_AVAILABLE, thus < 0 does check for both at once. I could change it to (numPartitions == UNKNOWN || numPartitions == NOT_AVAILABLE) of course... WDYT?

}
})
.through("topic2");
stream1.to("topic3");
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this output topic here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No really required. Will remove it. Guess it's a left over.

@asfbot
Copy link

asfbot commented Dec 10, 2016

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

@asfbot
Copy link

asfbot commented Dec 10, 2016

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

@asfbot
Copy link

asfbot commented Dec 10, 2016

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

@asfgit asfgit closed this in 1d586cb Dec 11, 2016
@guozhangwang
Copy link
Contributor

Merged to trunk.

@mjsax mjsax deleted the kafka-4476-stuck-on-missing-metadata branch December 11, 2016 22:40
soenkeliebau pushed a commit to soenkeliebau/kafka that referenced this pull request Feb 7, 2017
 - break loop in StreamPartitionAssigner.assign() in case partition metadata is missing
 - fit state transition issue (follow up to KAFKA-3637: Add method that checks if streams are initialised)
 - some test improvements

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Eno Thereska, Ismael Juma, Guozhang Wang

Closes apache#2209 from mjsax/kafka-4476-stuck-on-missing-metadata
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.

6 participants