Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

dmctl: simplify default query-status output (#334) #340

Merged
merged 14 commits into from
Oct 29, 2019

Conversation

sre-bot
Copy link

@sre-bot sre-bot commented Oct 29, 2019

cherry-pick #334 to release-1.0


What problem does this PR solve?

Current query-status command without any args in dmctl will print a lot of information but users are concerned about a little of them.

What is changed and how it works?

This PR generates and returns a simple task-list when users don't specify any arg. The proto files are not changed. This PR only generates task-list info in dmctl and modifies the output after receiving full dm-workers' info from dm-master.

The output will be like this format:

{
    "result": true,
    "msg: "",
    "tasks": [
        {
            "taskName": "task-1",
            "taskStatus": "Running",
            "workers": ["127.0.0.1:8262"]
        },
        {
            "taskName": "task-2",
            "taskStatus": "Error - Some error occurred in subtask",
            "workers": ["127.0.0.1:8262", "127.0.0.1:8263"]
        }
    ]
}

The status of a task is based on its subtasks. The definition is listed as follows:

Subtasks' status Task's status
Any Paused and len(result.errors) > 0 Error - Some error occurred in subtask
Any Running and unit is "Sync" and relay is Paused/Stopped Error - Relay status is Error/Paused/Stopped
Any Paused but without error Paused
All New New
All Finished Finished
All Stopped Stopped
Others Running

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@sre-bot sre-bot added priority/normal Minor change, requires approval from ≥1 primary reviewer needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated type/cherry-pick This PR is just a cherry-pick (backport) labels Oct 29, 2019
@codecov
Copy link

codecov bot commented Oct 29, 2019

Codecov Report

❗ No coverage uploaded for pull request base (release-1.0@2ce7693). Click here to learn what that means.
The diff coverage is 88.6363%.

@@               Coverage Diff                @@
##             release-1.0       #340   +/-   ##
================================================
  Coverage               ?   57.5979%           
================================================
  Files                  ?        158           
  Lines                  ?      15978           
  Branches               ?          0           
================================================
  Hits                   ?       9203           
  Misses                 ?       5876           
  Partials               ?        899

Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added the status/LGT1 One reviewer already commented LGTM label Oct 29, 2019
Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Oct 29, 2019
@csuzhangxc csuzhangxc merged commit 0285535 into pingcap:release-1.0 Oct 29, 2019
@csuzhangxc csuzhangxc removed the needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated label Nov 1, 2019
@csuzhangxc csuzhangxc added the already-update-release-note The release note is updated. Add this label once the release note is updated label Nov 1, 2019
@csuzhangxc csuzhangxc added already-update-docs The docs related to this PR already updated. Add this label once the docs are updated and removed needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated labels Mar 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-update-docs The docs related to this PR already updated. Add this label once the docs are updated already-update-release-note The release note is updated. Add this label once the release note is updated priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/cherry-pick This PR is just a cherry-pick (backport)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants