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

Extract HeartbeatDataProvider from Heartbeater #3571

Closed
ttyusupov opened this issue Feb 6, 2020 · 0 comments
Closed

Extract HeartbeatDataProvider from Heartbeater #3571

ttyusupov opened this issue Feb 6, 2020 · 0 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature

Comments

@ttyusupov
Copy link
Contributor

We have different logic inside Heartbeater::Thread::TryHeartbeat single method, particularly functionality for gathering tserver metrics for putting them into Heartbeat RPC.
For tablet splitting, we also need to put splitting-related information about tablets into Hearbeat
RPC. Overloading Heartbeater::Thread::TryHeartbeat with such extra functionality leads to unnecessary dependencies, tight coupling and unnecessary knowledge of Heartbeater about other components. Also, it makes Heartbeater code larger each time we need to add something new into Heartbeat.

Idea is to introduce HeartbeatDataProvider interface and move out of Heartbeater logic for
gathering tserver metrics into TServerMetricsHeartbeatDataProvider thus reducing Heartbeater complexity and removing unnecessary dependencies.

This framework will be used to implement TabletSplittingDataProvider for sending tablet splitting related data inside Heartbeat RPC.

@ttyusupov ttyusupov self-assigned this Feb 6, 2020
@ttyusupov ttyusupov added the area/docdb YugabyteDB core features label Feb 6, 2020
@ttyusupov ttyusupov added the kind/enhancement This is an enhancement of an existing feature label Feb 6, 2020
ttyusupov added a commit that referenced this issue Feb 20, 2020
Summary:
We have different logic inside `Heartbeater::Thread::TryHeartbeat` single method,
particularly functionality for gathering tserver metrics for putting them into Heartbeat RPC.
For tablet splitting we also need to put splitting-related information about tablets into Hearbeat
RPC. Overloading `Heartbeater::Thread::TryHeartbeat` with such extra functionality leads to
unnecessary dependencies, tight coupling and unnecessary knowledge of Heartbeater
about other components. Also it makes Heartbeater code larger each time we need to add something new
into Heartbeat.

This revision introduces HeartbeatDataProvider interface and moves out of Heartbeater logic for
gathering tserver metrics into TServerMetricsHeartbeatDataProvider thus reducing Heartbeater
complexity and removing unnecessary dependencies.

In subsequent revision for tablet splitting feature this framework will be used to implement
TabletSplittingDataProvider for sending tablet splitting related data inside Heartbeat RPC.

Fixed lint issues

Test Plan: Jenkins

Reviewers: mikhail, sergei, bogdan

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant