Skip to content

KAFKA-6718 / A Rack awareness for Kafka Streams#10785

Closed
lkokhreidze wants to merge 28 commits intoapache:trunkfrom
lkokhreidze:KAFKA-6718-rack-awareness-for-kafka-streams
Closed

KAFKA-6718 / A Rack awareness for Kafka Streams#10785
lkokhreidze wants to merge 28 commits intoapache:trunkfrom
lkokhreidze:KAFKA-6718-rack-awareness-for-kafka-streams

Conversation

@lkokhreidze
Copy link
Copy Markdown
Contributor

@lkokhreidze lkokhreidze commented May 28, 2021

KIP-708 implementation.

Notable changes:

  • Added required configuration options in StreamsConfig. Configurations are guarded by the validation rules and corresponding unit tests are present in StreamsConfigTest.
  • SubscriptionInfo version bump to 10 and added necessary fields for encoding client tags.
  • Moved standby task assignment logic behind StandbyTaskAssignor abstract class.
  • StandbyTaskAssignorInitializer decides which of the StandbyTaskAssignor implementations to use based on AssignmentConfigs
  • When AssignmentConfigs#rackAwareAssignmentTags is present, new ClientTagAwareStandbyTaskAssignor will be chosen which distributes the standby tasks based on client tags and configured rackAwareAssignmentTags

Committer Checklist (excluded from commit message)

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

final List<String> rackAwareAssignmentTags = getList(RACK_AWARE_ASSIGNMENT_TAGS_CONFIG);
final Map<String, String> clientTags = getClientTags();

for (final String rackAwareAssignmentTag : rackAwareAssignmentTags) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if doing validations in postProcessParsedConfig method is okay but couldn't find any better place.

import static org.apache.kafka.streams.integration.utils.IntegrationTestUtils.safeUniqueTestName;

@Category({IntegrationTest.class})
public class RackAwarenessIntegrationTest {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will try to figure out more test cases, but those should already be good starting point.

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class ClientTagAwareStandbyTaskAssignorTest {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will try to figure out more test cases, but those should already be good starting point.

@lkokhreidze lkokhreidze marked this pull request as ready for review May 30, 2021 23:15
@lkokhreidze
Copy link
Copy Markdown
Contributor Author

Call for review @vvcephei @cadonna @ableegoldman

import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Function;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the un-related changes :( happy to revert if it adds too much noise during the review.

@cadonna
Copy link
Copy Markdown
Member

cadonna commented May 31, 2021

@lkokhreidze Thank you for the PR!
This is quite a large PR. Could you split it up into smaller PRs that are easier to review?
One option could be to have a separate PR for:

  • standby task assignor
  • config changes
  • subscription info changes
  • ...

Opening small PRs usually increases the review quality and decreases time to the first review.

@lkokhreidze
Copy link
Copy Markdown
Contributor Author

Hi @cadonna
Thanks for the reply and suggestion. Will it be okay to have smaller PRs merged into trunk without having full functionality in place? Afair, when I worked on #7170, it was one of the motivations to have full functionality in trunk in one go.
If having partial implementation in trunk is OK, I can split this PR into smaller chunks.

@cadonna
Copy link
Copy Markdown
Member

cadonna commented Jun 1, 2021

As far as I can see from skimming the PR, you could have a PR for the standby task assignors with corresponding unit tests without changing any existing public functionality and without adding any partial public functionality. So I guess, it would be fine to have a PR for the standby task assignors. To give context to the reviewers, you should motivate the change in the PR description.

Maybe you can do similar with the subscription changes and with some other aspects of this PR. Probably, it would be good to have the config PR that makes the functionality available to the public last, so that the functionality is never partly publicly available.

I do not know the details of #7170, but most people with which I have talked about PR sizes agree that if it is possible to split them into smaller pieces, we should do it.

Note, that the title of the PR should start with the issue ID of the JIRA tickets which in this case would be KAFKA-6718. In this way a link to the PR will show up on the ticket. You can also open multiple PRs whose title starts with KAFKA-6718. A link for each PR will then show up in the ticket.

@lkokhreidze
Copy link
Copy Markdown
Contributor Author

Sounds good, will try to split the PR into smaller chunks.

@lkokhreidze lkokhreidze changed the title KIP-708 / A Rack awareness for Kafka Streams KAFKA-6718 / A Rack awareness for Kafka Streams Jun 1, 2021
@lkokhreidze
Copy link
Copy Markdown
Contributor Author

Closing this one as the PR is split into multiple smaller PRs.

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.

2 participants