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

MINOR: Partition is under reassignment when adding and removing #8364

Merged
merged 5 commits into from Apr 26, 2020

Conversation

jsancio
Copy link
Member

@jsancio jsancio commented Mar 26, 2020

A partition is under reassignment if the either the set of adding
replicas or set removing replicas is non-empty.

Fix the test assertion such that it prints stdout on failure.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@jsancio jsancio force-pushed the minor-under-replicated-test branch from 32d2047 to 98e7255 Compare March 30, 2020 20:46
@jsancio jsancio changed the title MINOR: Assume that metadata replies are eventually consistent. MINOR: Parition is under reassignment when adding and removing Mar 30, 2020
@ijuma
Copy link
Contributor

ijuma commented Mar 31, 2020

ok to test

@jsancio
Copy link
Member Author

jsancio commented Mar 31, 2020

@ijuma, we got the following error. It doesn't look related to this change

org.apache.kafka.streams.integration.QueryableStateIntegrationTest.concurrentAccesses failed, log available in /home/jenkins/jenkins-slave/workspace/kafka-pr-jdk11-scala2.13/streams/build/reports/testOutput/org.apache.kafka.streams.integration.QueryableStateIntegrationTest.concurrentAccesses.test.stdout

org.apache.kafka.streams.integration.QueryableStateIntegrationTest > concurrentAccesses FAILED
    java.lang.AssertionError: Did not receive all 48 records from topic output-concurrent-windowed-2 within 120000 ms
    Expected: is a value equal to or greater than <48>
         but: <0> was less than <48>
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.apache.kafka.streams.integration.utils.IntegrationTestUtils.lambda$waitUntilMinValuesRecordsReceived$6(IntegrationTestUtils.java:691)
        at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:415)
        at org.apache.kafka.test.TestUtils.retryOnExceptionWithTimeout(TestUtils.java:383)
        at org.apache.kafka.streams.integration.utils.IntegrationTestUtils.waitUntilMinValuesRecordsReceived(IntegrationTestUtils.java:687)
        at org.apache.kafka.streams.integration.QueryableStateIntegrationTest.waitUntilAtLeastNumRecordProcessed(QueryableStateIntegrationTest.java:1199)
        at org.apache.kafka.streams.integration.QueryableStateIntegrationTest.concurrentAccesses(QueryableStateIntegrationTest.java:650)

@ijuma ijuma changed the title MINOR: Parition is under reassignment when adding and removing MINOR: Partition is under reassignment when adding and removing Mar 31, 2020
@ijuma
Copy link
Contributor

ijuma commented Mar 31, 2020

So it turns out that this was an actual bug. Could we add a unit test that fails without this change?


final class TopicCommandTest {
@Test
def testIsNotUnderReplicatedWhenAdding(): Unit = {
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 test fails against trunk

kafka.admin.TopicCommandTest > testIsNotUnderReplicatedWhenAdding FAILED
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:87)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertFalse(Assert.java:65)
        at org.junit.Assert.assertFalse(Assert.java:75)
        at kafka.admin.TopicCommandTest.testIsNotUnderReplicatedWhenAdding(TopicCommandTest.scala:54)

1 test completed, 1 failed

@jsancio
Copy link
Member Author

jsancio commented Mar 31, 2020

So it turns out that this was an actual bug. Could we add a unit test that fails without this change?

@ijuma , Done.

  1. Renamed TopicCommandTest to TopicCommandWithZKClientTest
  2. Created a suite TopicCommandTest and added a unit test for this change. The new test fails against trunk.

@ijuma
Copy link
Contributor

ijuma commented Mar 31, 2020

ok to test

@ijuma
Copy link
Contributor

ijuma commented Mar 31, 2020

Hmm, maybe we should add the new test suite in a separate PR to avoid the large diff (rename detection would then kick in). What do you think?

@jsancio jsancio mentioned this pull request Mar 31, 2020
3 tasks
A partition is under reassignment if the either the set of adding
replicas or set removing replicas is non-empty.

Fix the test assertion such that it prints stdout on failure.
@jsancio jsancio force-pushed the minor-under-replicated-test branch from 2a21d44 to f276d28 Compare April 1, 2020 19:59
@jsancio
Copy link
Member Author

jsancio commented Apr 1, 2020

@ijuma PR ready.

@ijuma
Copy link
Contributor

ijuma commented Apr 1, 2020

Ok to test

@ijuma
Copy link
Contributor

ijuma commented Apr 23, 2020

retest this please

@jsancio jsancio force-pushed the minor-under-replicated-test branch from ebc391a to 0030c75 Compare April 24, 2020 22:01
@jsancio jsancio force-pushed the minor-under-replicated-test branch from 0030c75 to e4e2760 Compare April 24, 2020 22:04
@jsancio
Copy link
Member Author

jsancio commented Apr 24, 2020

Thanks for the review @ijuma

@ijuma
Copy link
Contributor

ijuma commented Apr 24, 2020

ok to test

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.

LGTM, thanks!

@ijuma
Copy link
Contributor

ijuma commented Apr 24, 2020

retest this please

@ijuma
Copy link
Contributor

ijuma commented Apr 24, 2020

ok to test

@ijuma
Copy link
Contributor

ijuma commented Apr 25, 2020

JDK 8 job failed due to infra issue, the other 2 passed.

@ijuma
Copy link
Contributor

ijuma commented Apr 25, 2020

retest this please

@ijuma
Copy link
Contributor

ijuma commented Apr 26, 2020

Unrelated failures for JDK 8:

kafka.api.CustomQuotaCallbackTest.testCustomQuotaCallback
kafka.api.CustomQuotaCallbackTest.testCustomQuotaCallback
kafka.api.PlaintextConsumerTest.testLowMaxFetchSizeForRequestAndPartition
kafka.api.PlaintextConsumerTest.testLowMaxFetchSizeForRequestAndPartition

@ijuma ijuma merged commit d63eaaa into apache:trunk Apr 26, 2020
ijuma added a commit to ijuma/kafka that referenced this pull request Apr 29, 2020
…t-for-generated-requests

* apache-github/trunk: (366 commits)
  MINOR: Improve producer test BufferPoolTest#testCloseNotifyWaiters. (apache#7982)
  MINOR: document how to escape json parameters to ducktape tests (apache#8546)
  KAFKA-9885; Evict last members of a group when the maximum allowed is reached (apache#8525)
  KAFKA-9866: Avoid election for topics where preferred leader is not in ISR (apache#8524)
  KAFKA-9839; Broker should accept control requests with newer broker epoch (apache#8509)
  KAKFA-9612: Add an option to kafka-configs.sh to add configs from a prop file (KIP-574)
  MINOR: Partition is under reassignment when adding and removing (apache#8364)
  MINOR: reduce allocations in log start and recovery checkpoints (apache#8467)
  MINOR: Remove unused foreign-key join class (apache#8547)
  HOTFIX: Fix broker bounce system tests (apache#8532)
  KAFKA-9704: Fix the issue z/OS won't let us resize file when mmap. (apache#8224)
  KAFKA-8639: Replace AddPartitionsToTxn with Automated Protocol  (apache#8326)
  MINOR: equals() should compare all fields for generated classes (apache#8539)
  KAFKA-9844; Fix race condition which allows more than maximum number of members(apache#8454)
  KAFKA-9823: Remember the sent generation for the coordinator request (apache#8445)
  KAFKA-9883: Add better error message when REST API forwards a request and leader is not known (apache#8536)
  KAFKA-9907: Switch default build to Scala 2.13 (apache#8537)
  MINOR: Some html fixes in Streams DSL documentation (apache#8503)
  MINOR: Enable fatal warnings with scala 2.13 (apache#8429)
  KAFKA-9852: Change the max duration that calls to the buffer pool can block from 2000ms to 10ms to reduce overall test runtime (apache#8464)
  ...
@jsancio jsancio deleted the minor-under-replicated-test branch July 14, 2021 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants