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

release-21.2: ui: Add Hot Ranges page #77594

Commits on Mar 17, 2022

  1. server: hot ranges api

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    f8def6a View commit details
    Browse the repository at this point in the history
  2. server: update hot ranges api/v2 version

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    7b75e0d View commit details
    Browse the repository at this point in the history
  3. server, ui: use POST request method for HotRangesV2 service

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    4fabb50 View commit details
    Browse the repository at this point in the history
  4. server: add pagination to hot ranges API

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    6e279d8 View commit details
    Browse the repository at this point in the history
  5. server: add store_id to hot ranges response api

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    8fcfd43 View commit details
    Browse the repository at this point in the history
  6. ui: add hot ranges page in Db Console

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    8c8e463 View commit details
    Browse the repository at this point in the history
  7. ui: add locality field to Hot ranges page

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    a3aaa81 View commit details
    Browse the repository at this point in the history
  8. ui: stying fixes for Hot Ranges page

    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
    koorosh committed Mar 17, 2022
    Configuration menu
    Copy the full SHA
    d9b4f0e View commit details
    Browse the repository at this point in the history