Skip to content

Commit 1c55138

Browse files
authored
v17 backport: Fix closed channel panic in Online DDL cutover (#13731)
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
1 parent 2da865e commit 1c55138

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

go/vt/vttablet/onlineddl/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,6 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er
860860
defer lockConn.Exec(ctx, sqlUnlockTables, 1, false)
861861

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

970969
e.updateMigrationStage(ctx, onlineDDL.UUID, "renaming tables")
971970
go func() {
971+
defer close(renameCompleteChan)
972972
_, err := renameConn.Exec(ctx, renameQuery.Query, 1, false)
973973
renameCompleteChan <- err
974974
}()

0 commit comments

Comments
 (0)