-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add flag --skip-metadata-lock-check #1616
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
Conversation
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.
Pull request overview
This pull request adds a new command-line flag --skip-metadata-lock-checks to allow users to bypass metadata lock validation during cut-over when performance_schema.metadata_locks cannot be enabled (e.g., on Aurora RDS). This addresses environments where enabling performance_schema may be infeasible while acknowledging a small risk of data loss.
Changes:
- Added
--skip-metadata-lock-checksflag to bypass metadata lock checks at cut-over - Enhanced
StateMetadataLockInstrument()to handle cases whereperformance_schemais disabled - Added validation logic in
initiateApplier()to conditionally bail out or warn based on flag
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/cmd/gh-ost/main.go | Added --skip-metadata-lock-checks flag definition and updated description for --allow-setup-metadata-lock-instruments flag |
| go/base/context.go | Added SkipMetadataLockChecks boolean field to MigrationContext |
| go/logic/applier.go | Modified StateMetadataLockInstrument() to handle ErrNoRows when performance_schema is disabled |
| go/logic/migrator.go | Added conditional logic to check SkipMetadataLockChecks flag and bail out or warn accordingly |
| doc/command-line-flags.md | Added documentation for both skip-metadata-lock-check and allow-setup-metadata-lock-instruments flags |
Comments suppressed due to low confidence (1)
doc/command-line-flags.md:257
- Inconsistent flag name in documentation text. The flag is defined as
--skip-metadata-lock-checks(plural) but the documentation refers to--skip-metadata-lock-check(singular). Update to use--skip-metadata-lock-checks.
By default `gh-ost` performs a check before the cut-over to ensure the rename session holds the exclusive metadata lock on the table. In case `performance_schema.metadata_locks` cannot be enabled on your setup, this check can be skipped with `--skip-metadata-lock-check`.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Since #1536,
performance_schema.metadata_locksis required to check the rename session holds the metadata lock on the migrated table during cut-over. On some setups such as Aurora RDSperformance_schemais not enabled by default and it may be infeasible to enable.This PR adds
--skip-metadata-lock-checkflag to skip the check in this case.Although the case described in #1536 is uncommon, data integrity is top priority for
gh-ost, so we recommend to enableperformance_schemaif possible.Closes #1615
script/cibuildreturns with no formatting errors, build errors or unit test errors.