Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
susanzhang27
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.