-
Notifications
You must be signed in to change notification settings - Fork 66
(WIP) support ecosystem tool binaries for TiDB #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems port is useless here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port is needed when adding connection "downstream" for the TiCDC downstream cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.