radondb / xenon

The MySQL Cluster Autopilot Management with GTID and Raft
GNU General Public License v3.0
693 stars 162 forks source link

feat(cli): Support `xenoncli cluster gtid json` #163

Closed runkecheng closed 2 years ago

runkecheng commented 2 years ago
/ $ xenoncli cluster gtid
+------------------------------------------+----------+-------+----------------------------------------------+--------------------+
|                    ID                    |   Raft   | Mysql |              Executed_GTID_Set               | Retrieved_GTID_Set |
+------------------------------------------+----------+-------+----------------------------------------------+--------------------+
| sample-mysql-0.sample-mysql.default:8801 | FOLLOWER | ALIVE | d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,␤ |                    |
|                                          |          |       | d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207   |                    |
+------------------------------------------+----------+-------+----------------------------------------------+--------------------+
| sample-mysql-2.sample-mysql.default:8801 | FOLLOWER | ALIVE | d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,␤ |                    |
|                                          |          |       | d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207   |                    |
+------------------------------------------+----------+-------+----------------------------------------------+--------------------+
| sample-mysql-1.sample-mysql.default:8801 | LEADER   | ALIVE | d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,␤ |                    |
|                                          |          |       | d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207   |                    |
+------------------------------------------+----------+-------+----------------------------------------------+--------------------+
(3 rows)
/ $ xenoncli cluster gtid json
{"gtid":[{"id":"sample-mysql-0.sample-mysql.default:8801","raft":"FOLLOWER","mysql":"ALIVE","executed-gtid-set":"d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207","retrieved-gtid-set":""},{"id":"sample-mysql-2.sample-mysql.default:8801","raft":"FOLLOWER","mysql":"ALIVE","executed-gtid-set":"d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207","retrieved-gtid-set":""},{"id":"sample-mysql-1.sample-mysql.default:8801","raft":"LEADER","mysql":"ALIVE","executed-gtid-set":"d15a207e-fc07-11ec-a5e2-a69762cda280:1-350,d4fd2dcf-fb89-11ec-8503-8e5c9c249e9b:1-207","retrieved-gtid-set":""}]}
codecov[bot] commented 2 years ago

Codecov Report

Merging #163 (0b458cb) into master (21c30dd) will increase coverage by 0%. The diff coverage is n/a.

:exclamation: Current head 0b458cb differs from pull request most recent head 57c12c1. Consider uploading reports for the commit 57c12c1 to get more accurate results

@@          Coverage Diff          @@
##           master   #163   +/-   ##
=====================================
  Coverage      69%    69%           
=====================================
  Files          51     51           
  Lines        4601   4601           
=====================================
+ Hits         3175   3182    +7     
+ Misses       1173   1167    -6     
+ Partials      253    252    -1     
Impacted Files Coverage Δ
src/raft/candidate.go 89% <0%> (+3%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 21c30dd...57c12c1. Read the comment docs.