m3db / m3

M3 monorepo - Distributed TSDB, Aggregator and Query Engine, Prometheus Sidecar, Graphite Compatible, Metrics Platform
https://m3db.io/
Apache License 2.0
4.7k stars 451 forks source link

Add verify_ids tool #4244

Closed vdarulis closed 9 months ago

vdarulis commented 11 months ago

verify_ids allows to query arbitrary m3db nodes for provided IDs (or a somewhat random set) and either produce the results as a JSON blob with results grouped per node, or print out the data and do a simple data consistency check, eg.:

#  ./verify_ids -nodes 10.24.144.134:9000,localhost:9000
...
===
ID: {__name__="foo"}
          Timestamp|10.24.144.134:9000|localhost:9000|
Jul 10 16:00:03.953|        756.000000|    756.000000|
Jul 10 16:00:18.953|        758.000000|    758.000000|
Jul 10 16:00:33.954|        761.000000|    761.000000|
Jul 10 16:00:48.955|        762.000000|    762.000000|
Jul 10 16:01:03.956|        764.000000|    764.000000|
...

# ./verify_ids -nodes 10.24.144.134:9000,10.24.149.166:9000
..
Mismatches (timestamp, node) for ID: {__name__="foo"}
Jul 10 16:00:01.447 10.24.149.166:9000
Jul 10 16:00:16.448 10.24.149.166:9000
Jul 10 16:00:31.449 10.24.149.166:9000
Jul 10 16:00:46.449 10.24.149.166:9000
Jul 10 16:01:01.450 10.24.149.166:9000
...

What this PR does / why we need it:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:

Does this PR require updating code package or user-facing documentation?: