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-4266: ReassignPartitionsClusterTest - Ensure ZK publication completed before start #1997

Closed
wants to merge 6 commits into from

Conversation

benstopford
Copy link
Contributor

@benstopford benstopford commented Oct 8, 2016

Increase the reliability of the one temporal comparison in ReassignPartitionsClusterTest by imposing a delay after ZK is updated. This should be more reliable than just increasing the amount of data.

This relates to a previous PR: #1982

AdminUtils.changeBrokerConfig(zkUtils, Seq(id), configs)
}
Thread.sleep(throttle.postUpdateDelay)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please elaborate a little on which scenario is made more reliable by this sleep?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the rebalance kicks in before the throttle is set data isn't replicated. The current solution is to just make the test run for longer, with more data, so it averages out.

It's in response to this commit: 5e4600a

@silpamittapalli
Copy link

We too are experiencing fragility in ReassignPartitionsClusterTest and this PR seems to address the fragile test. Are there any plans of merging this PR?

@asfbot
Copy link

asfbot commented Feb 8, 2017

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

@asfbot
Copy link

asfbot commented Feb 8, 2017

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

@asfbot
Copy link

asfbot commented Feb 8, 2017

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

@ijuma
Copy link
Contributor

ijuma commented Feb 8, 2017

@silpamittapalli, have you verified that this fixes the issues you are seeing?

@silpamittapalli
Copy link

Yes, it addresses the fragile test @ijuma

@benstopford
Copy link
Contributor Author

happy to rebase if @ijuma has time to review?

@ijuma
Copy link
Contributor

ijuma commented Feb 27, 2017

@benstopford, yes, I can review it tomorrow.

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

@benstopford
Copy link
Contributor Author

@ijuma rebased dude

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

@asfbot
Copy link

asfbot commented Feb 27, 2017

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

import org.apache.kafka.common.utils.Utils
import org.apache.kafka.common.security.JaasUtils

object ReassignPartitionsCommand extends Logging {

case class Throttle (value: Long, postUpdateDelay: Int = 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

A minor nit: could we take a function postUpdate: () => Unit and then do the sleep in the test? That seems a bit nicer than having the sleep in the command. Apart from that, this looks OK, I could not think of a better way to detect that the throttling information had propagated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Done

configs.put(DynamicConfig.Broker.LeaderReplicationThrottledRateProp, throttle.toString)
configs.put(DynamicConfig.Broker.FollowerReplicationThrottledRateProp, throttle.toString)
configs.put(DynamicConfig.Broker.LeaderReplicationThrottledRateProp, throttle.value.toString)
configs.put(DynamicConfig.Broker.FollowerReplicationThrottledRateProp, throttle.value.toString)
admin.changeBrokerConfig(zkUtils, Seq(id), configs)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

One other question, should the delay be here or after assignThrottledReplicas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed - switched the order so all config is updated before the post update action. Considered putting a post update action into each method but it seems like more noise so I think this is the best balance.

@benstopford
Copy link
Contributor Author

@ijuma changes made as requested.

…ted before proceeding with the test (where applicable)
- Pulled out sleep into test using a post update action.
- Reordered config updates so sleep is at the end.
@asfbot
Copy link

asfbot commented Mar 5, 2017

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

@asfbot
Copy link

asfbot commented Mar 5, 2017

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

@asfbot
Copy link

asfbot commented Mar 5, 2017

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


package kafka.admin

case class Throttle (value: Long, action: PostUpdateAction = NoPostUpdateAction)
Copy link
Contributor

@ijuma ijuma Mar 5, 2017

Choose a reason for hiding this comment

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

Is there a reason why you used a PostUpdateAction class instead of just a function? e.g.:

case class Throttle(value: Long, postUpdateAction: () => Unit = () => ())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Laziness (i needed a class at an earlier point).

@benstopford
Copy link
Contributor Author

@ijuma Removed the redundant class. Thanks for the review.

@asfbot
Copy link

asfbot commented Mar 6, 2017

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

@asfbot
Copy link

asfbot commented Mar 6, 2017

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

@asfgit asfgit closed this in 63010cb Mar 6, 2017
@ijuma
Copy link
Contributor

ijuma commented Mar 6, 2017

Thanks, LGTM. I did a few minor tweaks before merging.

@asfbot
Copy link

asfbot commented Mar 6, 2017

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

efeg pushed a commit to efeg/kafka that referenced this pull request May 29, 2024
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.

4 participants