-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-21.2: ui: Add Hot Ranges page #77594
release-21.2: ui: Add Hot Ranges page #77594
Conversation
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
1231b8d
to
ba2889b
Compare
This change implements second version of hot ranges api that's required for UI to represent enhanced Hot Ranges page. Before, Hot ranges (under Advanced debugging page) used former version of HotRanges api that provided information about hot ranges with internal/ sensitive data (see: cockroachdb#53212) that should not be exposed to users. Now, in addition to existing endpoint, additional one is implemented that is based on a former version and provides hot ranges information that is only needed for Hot Ranges page (range id, qps, table, db, and index names for particular range). The list of hot ranges and their QPS is provided by `HotRanges` service and then information like DB, table and index names are retrieved from range's `StartKey` that might include this info or not (in case if it's meta range, or range that stores index itself for instance). `HotRange` and `HotRangeV2` services expect the same request type as an argument but return different responses. `HotRangeV2` service returns a flat list of hot ranges instead of grouped ranges per node/store. Release note: None server: add leaseholder node id to hot ranges api Current change extends `statuspb.HotRangesResponse` to include `LeaseholderNodeID` field to indicate the node id that contains leaseholder replica for current hot range. This change was made in `localHotRanges` function (that is used by `HotRanges` that in turn used by `HotRangeV2` service) to reuse existing logic of iteration over the stores and querying hot ranges. It extends its response by `LeaseholderNodeID` field. Otherwise, the same logic should be implemented in `HotRangeV2` service by calling `VisitStores` iterator. Release note: None Release justification: bug fixes and low-risk updates to new functionality
Before, `listHotRanges` request handler of `apiV2Server` relied on `HotRanges` service that is now should be replaced by new `HotRangesV2` implementation. Current change reuses HotRangeV2 service in `api/v2/ranges/hot` api. It allows to share the same logic between REST and gRPC endpoints and gradually migrate to new version of API. Release note: None Release justification: bug fixes and low-risk updates to new functionality
Initially, `HotRangesV2` service in status server was defined to use GET method to handle HTTP request. It was convenient way to display response data in Advanced debugging page since it allowed to render response body right on to page. But now, hot ranges will be used on user facing page and request dispatching for hot ranges api should follow generic workflow: initialize `HotRangesRequest` protobuf message and dispatch request with `src/util/api` service. This restriction forces to use POST method (since GET method doesn't allow to provide request body). In addition, Hot Ranges debugging page is refactored to use `api` service. Release note: None Release justification: bug fixes and low-risk updates to new functionality
This change extends hot ranges API to support pagination of responses. It is also possible to avoid pagination when page size is set to 0. Release note: None Release justification: bug fixes and low-risk updates to new functionality
This change extends HotRangesResponseV2 message to include store ID data. This information can be useful to investigate cause of hot ranges. Release note: None Release justification: bug fixes and low-risk updates to new functionality
This change adds a new page in Db Console - Hot Ranges that display list of hot ranges in the cluster and some useful information related to each range. The main goal of this page is to help eliminate root cause of hot ranges. This page uses already implemented hot ranges API (V2) that provides all necessary data to show. Release note (ui change): add Hot Ranges page and link to it on the sidebar Release justification: bug fixes and low-risk updates to new functionality
Before, Hot Ranges page provided a list of hot ranges info without localities of nodes where range is stored. This information is very useful during investigation of hot ranges. Current change, adds one more column to hot ranges table with localities represented in human-readable way. Release note: None Release justification: bug fixes and low-risk updates to new functionality
Current change contains list of small visual improvements for Hot Ranges page: - Capitalize "Hot Ranges" in navigation panel and page header; - Update page description and put it inside inline info panel; - Proper margins between header and text description; Release note: None Release justification: bug fixes and low-risk updates to new functionality
ba2889b
to
d9b4f0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 30 of 30 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @thtruo and @zachlite)
Backport:
Please see individual PRs for details.
/cc @cockroachdb/release
Release justification: bug fixes and low-risk updates to new functionality