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

feat: Adds lag reporting and API for use in lag aware routing as described in KLIP 12 #4392

Merged
merged 22 commits into from
Jan 30, 2020

Conversation

AlanConfluent
Copy link
Member

Description

This creates a Service which sends state store changelog topic lags retrieved from KafkaStreams to all of the nodes in the cluster. It also has an API which can be used by pull request logic for making routing decisions.

Testing done

Added unit tests for LagReportingAgent which tests APIs. Also added a functional test LagReportingAgentFunctionalTest which actually sets up a two node cluster, sends lags, and verifies those reported with those read directly from Kafka.

Will also do additional manual testing according to this document: #4360

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@AlanConfluent AlanConfluent requested a review from agavra January 27, 2020 19:36
@AlanConfluent AlanConfluent requested a review from a team as a code owner January 27, 2020 19:36
@ghost
Copy link

ghost commented Jan 27, 2020

@confluentinc It looks like @AlanConfluent just signed our Contributor License Agreement. 👍

Always at your service,

clabot

Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

LGTM - most of my comments are code-level

if (host.equals(localHostString)) {
continue;
}
final TreeMap<Long, HeartbeatInfo> heartbeats = receivedHeartbeats.get(host);
//For previously discovered hosts, if they have not received any heartbeats, mark them dead
if (heartbeats == null || heartbeats.isEmpty()) {
hostsStatus.get(host).setHostAlive(false);
hostsStatus.put(host, new HostStatusEntity(status.getHostInfoEntity(),
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above (and one more time below), but to make life easier we could just use computeIfPresent to make it clear that the key isn't changing

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to computeIfPresent.

@AlanConfluent AlanConfluent merged commit cb9ae29 into confluentinc:master Jan 30, 2020
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