Skip to content

Commit

Permalink
DDL: add log when TiFlash replica available changed (#39243)
Browse files Browse the repository at this point in the history
close #39242
  • Loading branch information
hehechen authored Nov 28, 2022
1 parent 89522b1 commit 68178d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ func onUpdateFlashReplicaStatus(d *ddlCtx, t *meta.Meta, job *model.Job) (ver in
newIDs = append(newIDs, tblInfo.TiFlashReplica.AvailablePartitionIDs[i+1:]...)
tblInfo.TiFlashReplica.AvailablePartitionIDs = newIDs
tblInfo.TiFlashReplica.Available = false
logutil.BgLogger().Info("TiFlash replica become unavailable", zap.Int64("tableID", tblInfo.ID), zap.Int64("partitionID", id))
break
}
}
Expand All @@ -1350,6 +1351,9 @@ func onUpdateFlashReplicaStatus(d *ddlCtx, t *meta.Meta, job *model.Job) (ver in
return ver, errors.Errorf("unknown physical ID %v in table %v", physicalID, tblInfo.Name.O)
}

if tblInfo.TiFlashReplica.Available {
logutil.BgLogger().Info("TiFlash replica available", zap.Int64("tableID", tblInfo.ID))
}
ver, err = updateVersionAndTableInfo(d, t, job, tblInfo, true)
if err != nil {
return ver, errors.Trace(err)
Expand Down

0 comments on commit 68178d6

Please sign in to comment.