Skip to content
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

SHOW VITESS_MIGRATION '...' LOGS, retain logs for 24 hours #8532

Conversation

shlomi-noach
Copy link
Contributor

Resubmission of #8493, for 11.0 release branch.

Description

Fixes #8178

  • Support for show vitess_migration '<uuid>' logs queries, e.g. show vitess_migration '4835ca51_e867_11eb_ab12_0a43f95f28a3' logs
  • Retaining migration logs for 24 hours after migration completion, whether migration is successful or not.

gh-ost and pt-osc (but not online) migrations generate a migration log, which Vitess stores in a well known location on the primary tablet.

It is now possible to view the file, during or after migration. The file is retained for 24 hours after completion/failure.

The command show vitess_migration '<uuid>' logs will output the entire log file content for each shard. Therefore, 4 shards => 4 log files.

This is tested in go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go

Documentation to follow

Example:

mysql> show vitess_migration '3a273866_e867_11eb_ab12_0a43f95f28a3' logs \G
*************************** 1. row ***************************
migration_log: 2021-07-19 07:59:23 INFO starting gh-ost 261355426d8fc31b590733ca8ff8e79012103c18
2021-07-19 07:59:23 INFO Migrating `vt_commerce`.`corder`
2021-07-19 07:59:23 INFO executing gh-ost-on-startup hook: /tmp/online-ddl-3a273866_e867_11eb_ab12_0a43f95f28a3-943208852/gh-ost-on-startup
ok
2021-07-19 07:59:23 INFO inspector connection validated on ip-REDACTED:17100
2021-07-19 07:59:23 INFO User has SUPER, REPLICATION SLAVE privileges, and has ALL privileges on `vt_commerce`.*
2021-07-19 07:59:23 INFO binary logs validated on ip-REDACTED:17100
2021-07-19 07:59:23 INFO Restarting replication on ip-REDACTED:17100 to make sure binlog settings apply to replication thread
2021-07-19 07:59:23 INFO Inspector initiated on ip-REDACTED:17100, version 5.7.30-log
2021-07-19 07:59:23 INFO Table found. Engine=InnoDB
...

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach shlomi-noach added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Query Serving labels Jul 26, 2021
@shlomi-noach shlomi-noach marked this pull request as draft July 26, 2021 06:20
@shlomi-noach shlomi-noach marked this pull request as ready for review July 26, 2021 06:31
@shlomi-noach shlomi-noach merged commit 810c792 into vitessio:release-11.0 Jul 26, 2021
@shlomi-noach shlomi-noach deleted the onlineddl-show-vitess-migration-log-release-11 branch July 26, 2021 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants