Skip to content

[DO NOT MERGE] Testing #1500 #1518

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

Closed
wants to merge 15 commits into from
Closed

Conversation

meiji163
Copy link
Contributor

@meiji163 meiji163 commented Mar 18, 2025

Testing #1500 internally. Do not merge.

@Copilot Copilot AI review requested due to automatic review settings March 18, 2025 23:28
susanzhang27
susanzhang27 previously approved these changes Mar 18, 2025
Copy link
Contributor

@Copilot 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 PR introduces changes to improve iteration range handling and SQL warning detection during data migration while adding new configuration options. Key changes include:

  • Modifying the return signature and logic of CalculateNextIterationRangeEndValues in applier.go.
  • Integrating SQL warning detection in ApplyIterationInsertQuery and adjusting error handling in migrator.go.
  • Updating SQL query builders and associated tests, and adding a new flag "panic-on-warnings" in main.go.

Reviewed Changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dev.yml Adds a new development configuration file for test environments.
go/logic/applier.go Updates iteration range calculation and SQL warnings processing logic.
go/logic/migrator.go Adjusts iteration processing to incorporate expected row count and SQL warning handling.
go/sql/builder_test.go Updates test expectations for SQL query generation.
go/sql/builder.go Revises SQL builder functions and notes an unused variable.
go/cmd/gh-ost/main.go Introduces a new CLI flag for triggering panic on SQL warnings.
go/base/context.go Adds new context fields to support panic-on-warnings functionality.
Files not reviewed (6)
  • localtests/panic-on-warnings-duplicate-unique-values-on-column-type-change/create.sql: Language not supported
  • localtests/panic-on-warnings-duplicate-unique-values-on-column-type-change/expect_failure: Language not supported
  • localtests/panic-on-warnings-duplicate-unique-values-on-column-type-change/extra_args: Language not supported
  • localtests/panic-on-warnings-duplicate-values-for-unique-index/create.sql: Language not supported
  • localtests/panic-on-warnings-duplicate-values-for-unique-index/expect_failure: Language not supported
  • localtests/panic-on-warnings-duplicate-values-for-unique-index/extra_args: Language not supported

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

- podman
- custom:
name: Go Dependencies
met?: go mod download
Copy link
Preview

Copilot AI Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key 'met?' is inconsistent with the key 'meet' on the following line, which may lead to configuration errors. Both keys should be identical if they are intended to represent the same check.

Copilot uses AI. Check for mistakes.

}
if expectedRangeSize != rowsAffected {
joinedWarnings := strings.Join(this.migrationContext.MigrationLastInsertSQLWarnings, "; ")
terminateRowIteration(fmt.Errorf("ApplyIterationInsertQuery failed because of SQL warnings: [%s]", joinedWarnings))
Copy link
Preview

Copilot AI Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to 'terminateRowIteration' is not returned, so its effect on the control flow is lost. Prepend 'return' to properly terminate the iteration when SQL warnings occur.

Suggested change
terminateRowIteration(fmt.Errorf("ApplyIterationInsertQuery failed because of SQL warnings: [%s]", joinedWarnings))
return terminateRowIteration(fmt.Errorf("ApplyIterationInsertQuery failed because of SQL warnings: [%s]", joinedWarnings))

Copilot uses AI. Check for mistakes.

@@ -275,7 +275,7 @@ func BuildUniqueKeyRangeEndPreparedQueryViaOffset(databaseName, tableName string

uniqueKeyColumnNames := duplicateNames(uniqueKeyColumns.Names())
uniqueKeyColumnAscending := make([]string, len(uniqueKeyColumnNames))
uniqueKeyColumnDescending := make([]string, len(uniqueKeyColumnNames))
uniqueKeyColumnDescending := make([]string, len(uniqueKeyColumnNames)) // TODO unused variable
Copy link
Preview

Copilot AI Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'uniqueKeyColumnDescending' is declared but never used. Remove it if it is not needed to avoid confusion.

Suggested change
uniqueKeyColumnDescending := make([]string, len(uniqueKeyColumnNames)) // TODO unused variable

Copilot uses AI. Check for mistakes.

@meiji163 meiji163 changed the title [Do not merge] Testing #1500 [DO NOT MERGE] Testing #1500 Mar 18, 2025
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.

3 participants