(WIP) support ecosystem tool binaries for TiDB#133
(WIP) support ecosystem tool binaries for TiDB#133bb7133 wants to merge 5 commits intopingcap:masterfrom
Conversation
| tmpDir := fmt.Sprintf("/tmp/%s_%s", source, uuid) | ||
|
|
||
| // Generate the SQL statements | ||
| backupSQL := fmt.Sprintf("BACKUP TABLE `%s` TO '%s'", source, tmpDir) |
There was a problem hiding this comment.
It seems that already supports backup and restore SQL, maybe we can use SQL directly instead of use comments.
There was a problem hiding this comment.
Yeah, when I added 'backup_and_restore' command, I was thinking br binaries. However, it might be OK to just use SQL now and only try br binary when needed.
There was a problem hiding this comment.
mmm...it is not straightforward to use SQL directly:
BACKUP TABLE T TO 'LOCAL:///TMP/BR';
Destination Size BackupTS Queue Time Execution Time
local:///TMP/BR 3687 453115446250176572 2024-10-09 11:24:13 2024-10-09 11:24:13
DROP TABLE T;
RESTORE TABLE T FROM 'LOCAL:///TMP/BR';
Destination Size BackupTS Cluster TS Queue Time Execution Time
local:///TMP/BR 3687 453115446250176572 453115447167680565 2024-10-09 11:24:17 2024-10-09 11:24:17
The return rows of BACKUP and RESTORE are time-specific.
There was a problem hiding this comment.
we could use --disable_result_log to disable print return rows. I think decoupling these functions will make it more convenient to use.
| return path, nil | ||
| } | ||
|
|
||
| func (t *tester) importTableStmt(path, target string) string { |
There was a problem hiding this comment.
ditto, use SQL directly is better.
| } | ||
|
|
||
| func (t *tester) addConnection(connName, hostName, userName, password, db string) { | ||
| func (t *tester) addConnection(connName, hostName, port, userName, password, db string) { |
There was a problem hiding this comment.
Seems port is useless here.
There was a problem hiding this comment.
port is needed when adding connection "downstream" for the TiCDC downstream cluster.
There was a problem hiding this comment.
I got it, it's designed for the future!
As described, I plan to introduce more commands to trigger BR(binary) / Dumpling / Lightning(binary) and TiCDC, so that we're able to write tests with those tools.