pingcap / br

A command-line tool for distributed backup and restoration of the TiDB cluster data
https://pingcap.com/docs/dev/how-to/maintain/backup-and-restore/br/
Apache License 2.0
123 stars 102 forks source link

log backup result(success/failure) in backupmeta #1420

Open IANTHEREAL opened 3 years ago

IANTHEREAL commented 3 years ago

Feature Request

Describe your feature request related problem:

The backup feature of TiDB is currently executed by a tool br. Now user can only monitoring the running of this tool br, and check the final log to confirm the backup result.

successful log example:

[2021/08/04 10:06:45.055 +08:00] [INFO] [collector.go:67] ["Full restore success summary"] [total-ranges=37] [ranges-succeed=37] [ranges-failed=0] [split-region=362.373805ms] [restore-checksum=6.890396086s] [restore-ranges=29] [total-take=17.328491842s] ["restore data size(after compressed)"=496.7MB] [total-kv=15462460] [total-kv-size=1.858GB] [average-speed=107.2MB/s]

But I consider that it's better to write the backup result to backup metadata. And after supporting backup/restore via SQL in TiDB, user can query the metadata through SQL.

This will make it easier for users to maintenance

Describe the feature you'd like:

log backup result(success/failure) in backupmeta

kennytm commented 3 years ago

for BR in SQL you could do SHOW BACKUPS since pingcap/tidb#22699

rahilsh commented 3 years ago

Is there a way for BR tool to call API(callback) of my service or push message to messaging service(kafka or sqs) when backup's state changes

IANTHEREAL commented 3 years ago

still not, currently it can only be achieved by writing a script, we will consider it later @rahilsh

YuJuncen commented 3 years ago

So I guess the final artifact should be a SQL stmt like SHOW BACKUP INFO IN $storage?