Skip to content

Conversation

@meiji163
Copy link
Contributor

@meiji163 meiji163 commented Jan 16, 2026

Description

Since #1536, performance_schema.metadata_locks is required to check the rename session holds the metadata lock on the migrated table during cut-over. On some setups such as Aurora RDS performance_schema is not enabled by default and it may be infeasible to enable.
This PR adds --skip-metadata-lock-check flag 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 enable performance_schema if possible.

Closes #1615

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

Copilot AI review requested due to automatic review settings January 16, 2026 21:22
Copy link
Contributor

Copilot AI left a 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-checks flag to bypass metadata lock checks at cut-over
  • Enhanced StateMetadataLockInstrument() to handle cases where performance_schema is 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.

@meiji163 meiji163 changed the title Add flag --skip-metadata-lock-checks Add flag --skip-metadata-lock-check Jan 16, 2026
@meiji163 meiji163 merged commit cc2dd7f into master Jan 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aurora rds and performance_schema.setup_instruments error

3 participants