Skip to content

Commit

Permalink
Fix closed channel panic in Online DDL cutover (vitessio#13729)
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Aug 7, 2023
1 parent ec7f8a3 commit 36ea44e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/vt/vttablet/onlineddl/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er
defer lockConn.Exec(ctx, sqlUnlockTables, 1, false)

renameCompleteChan := make(chan error)
defer close(renameCompleteChan)
renameWasSuccessful := false
renameConn, err := e.pool.Get(ctx, nil)
if err != nil {
Expand Down Expand Up @@ -969,6 +968,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er

e.updateMigrationStage(ctx, onlineDDL.UUID, "renaming tables")
go func() {
defer close(renameCompleteChan)
_, err := renameConn.Exec(ctx, renameQuery.Query, 1, false)
renameCompleteChan <- err
}()
Expand Down

0 comments on commit 36ea44e

Please sign in to comment.