Skip to content

Commit

Permalink
Merge branch 'master' into merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove authored Nov 23, 2020
2 parents 802b2b7 + d1c4866 commit 75553c1
Show file tree
Hide file tree
Showing 79 changed files with 1,336 additions and 1,329 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
TiUP Changelog

## [1.2.4] 2020.11.19

### Fixes

- Fix the issue that Pump & Drainer has different node id between tidb-ansible and TiUP ([#903](https://github.com/pingcap/tiup/pull/903), [@lucklove](https://github.com/lucklove))
- For the cluster imported from tidb-ansible, if the pump or drainer is restarted, it will start with a new node id
- Risk of this issue: binlog may not work correctly after restart pump or drainer
- Fix the issue that audit log may get lost in some special case ([#879](https://github.com/pingcap/tiup/pull/879), [#882](https://github.com/pingcap/tiup/pull/882), [@9547](https://github.com/9547))
- If the user execute two commands one follows the other, and the second one quit in 1 second, the audit log of the first command will be overwirten by the second one
- Risk caused by this issue: some audit logs may get lost in above case
- Fix the issue that new component deployed with `tiup cluster scale-out` doesn't auto start when rebooting ([#905](https://github.com/pingcap/tiup/pull/905), [@9547](https://github.com/9547))
- Risk caused by this issue: the cluster may be unavailable after rebooting
- Fix the issue that data directory of tiflash is not deleted if multiple data directories are specified ([#871](https://github.com/pingcap/tiup/pull/871), [@9547](https://github.com/9547))
- Fix the issue that `node_exporter` and `blackbox_exporter` not cleaned up after scale-in all instances on specified host ([#857](https://github.com/pingcap/tiup/pull/857), [@9547](https://github.com/9547))
- Fix the issue that the patch command will fail when try to patch dm cluster ([#884](https://github.com/pingcap/tiup/pull/884), [@lucklove](https://github.com/lucklove))
- Fix the issue that the bench component report `Error 1105: client has multi-statement capability disabled` ([#887](https://github.com/pingcap/tiup/pull/887), [@mahjonp](https://github.com/mahjonp))
- Fix the issue that the TiSpark node can't be upgraded ([#901](https://github.com/pingcap/tiup/pull/901), [@lucklove](https://github.com/lucklove))
- Fix the issue that tiup-playground can't start TiFlash with newest nightly PD ([#902](https://github.com/pingcap/tiup/pull/902), [@lucklove](https://github.com/lucklove))

### Improvements

- Ignore no tispark master error when listing clusters since the master node may be remove by `scale-in --force` ([#920](https://github.com/pingcap/tiup/pull/920), [@AstroProfundis](https://github.com/AstroProfundis))

## [1.2.3] 2020.10.30

### Fixes
Expand Down
1 change: 1 addition & 0 deletions cmd/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var envList = []string{
localdata.EnvNameSCPPath,
localdata.EnvNameKeepSourceTarget,
localdata.EnvNameMirrorSyncScript,
localdata.EnvNameLogPath,
}

func newEnvCmd() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ func newMirrorCloneCmd() *cobra.Command {
}
defer repo.Mirror().Close()

var versionMapper = func(ver string) string {
return spec.TiDBComponentVersion(ver, "")
var versionMapper = func(comp string) string {
return spec.TiDBComponentVersion(comp, "")
}

return repository.CloneMirror(repo, components, versionMapper, args[0], args[1:], options)
Expand Down
5 changes: 5 additions & 0 deletions components/cluster/command/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ func newImportCmd() *cobra.Command {
return err
}

// copy config detail to meta file
if err = ansible.LoadConfig(clsName, clsMeta); err != nil {
return err
}

if err = spec.SaveClusterMeta(clsName, clsMeta); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion components/cluster/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func Execute() {
}

if !errorx.HasTrait(err, errutil.ErrTraitPreCheck) {
logger.OutputDebugLog()
logger.OutputDebugLog("tiup-cluster")
}

if errx := errorx.Cast(err); errx != nil {
Expand Down
24 changes: 1 addition & 23 deletions components/cluster/command/scale_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
package command

import (
"context"
"io/ioutil"
"path/filepath"

"github.com/pingcap/tiup/pkg/cluster"
"github.com/pingcap/tiup/pkg/cluster/executor"
operator "github.com/pingcap/tiup/pkg/cluster/operation"
"github.com/pingcap/tiup/pkg/cluster/report"
"github.com/pingcap/tiup/pkg/cluster/spec"
"github.com/pingcap/tiup/pkg/cluster/task"
"github.com/pingcap/tiup/pkg/utils"
Expand Down Expand Up @@ -78,15 +75,6 @@ func newScaleOutCmd() *cobra.Command {
return cmd
}

// Deprecated
func convertStepDisplaysToTasks(t []*task.StepDisplay) []task.Task {
tasks := make([]task.Task, 0, len(t))
for _, sd := range t {
tasks = append(tasks, sd)
}
return tasks
}

func final(builder *task.Builder, name string, meta spec.Metadata) {
builder.UpdateTopology(name,
tidbSpec.Path(name),
Expand All @@ -96,15 +84,5 @@ func final(builder *task.Builder, name string, meta spec.Metadata) {
}

func postScaleOutHook(builder *task.Builder, newPart spec.Topology) {
nodeInfoTask := task.NewBuilder().Func("Check status", func(ctx *task.Context) error {
var err error
teleNodeInfos, err = operator.GetNodeInfo(context.Background(), ctx, newPart)
_ = err
// intend to never return error
return nil
}).BuildAsStep("Check status").SetHidden(true)

if report.Enable() {
builder.Parallel(false, convertStepDisplaysToTasks([]*task.StepDisplay{nodeInfoTask})...)
}
postDeployHook(builder, newPart)
}
12 changes: 6 additions & 6 deletions components/dm/ansible/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (im *Importer) handleWorkerConfig(srv *spec.WorkerSpec, fname string) error

// ScpSourceToMaster scp the source files to master,
// and set V1SourcePath of the master spec.
func (im *Importer) ScpSourceToMaster(topo *spec.Topology) (err error) {
func (im *Importer) ScpSourceToMaster(topo *spec.Specification) (err error) {
for i := 0; i < len(topo.Masters); i++ {
master := &topo.Masters[i]
target := filepath.Join(firstNonEmpty(master.DeployDir, topo.GlobalOptions.DeployDir), "v1source")
Expand Down Expand Up @@ -293,7 +293,7 @@ func (im *Importer) ImportFromAnsibleDir() (clusterName string, meta *spec.Metad
}

meta = &spec.Metadata{
Topology: new(spec.Topology),
Topology: new(spec.Specification),
}
topo := meta.Topology

Expand Down Expand Up @@ -480,7 +480,7 @@ func (im *Importer) ImportFromAnsibleDir() (clusterName string, meta *spec.Metad
}
case "alertmanager_servers":
for _, host := range group.Hosts {
srv := spec.AlertManagerSpec{
srv := spec.AlertmanagerSpec{
Host: host.Vars["ansible_host"],
SSHPort: ansible.GetHostPort(host, cfg),
DeployDir: firstNonEmpty(host.Vars["deploy_dir"], topo.GlobalOptions.DeployDir),
Expand Down Expand Up @@ -521,9 +521,9 @@ func (im *Importer) ImportFromAnsibleDir() (clusterName string, meta *spec.Metad
}
}

srv.DeployDir = instancDeployDir(spec.ComponentAlertManager, srv.WebPort, host.Vars["deploy_dir"], topo.GlobalOptions.DeployDir)
srv.DeployDir = instancDeployDir(spec.ComponentAlertmanager, srv.WebPort, host.Vars["deploy_dir"], topo.GlobalOptions.DeployDir)

topo.Alertmanager = append(topo.Alertmanager, srv)
topo.Alertmanagers = append(topo.Alertmanagers, srv)
}
case "grafana_servers":
for _, host := range group.Hosts {
Expand Down Expand Up @@ -559,7 +559,7 @@ func (im *Importer) ImportFromAnsibleDir() (clusterName string, meta *spec.Metad
}

srv.DeployDir = instancDeployDir(spec.ComponentGrafana, srv.Port, host.Vars["deploy_dir"], topo.GlobalOptions.DeployDir)
topo.Grafana = append(topo.Grafana, srv)
topo.Grafanas = append(topo.Grafanas, srv)
}
case "all", "ungrouped":
// ignore intent
Expand Down
10 changes: 5 additions & 5 deletions components/dm/ansible/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ func TestImportFromAnsible(t *testing.T) {
assert.Equal(expectedWorker, worker)

// check Alertmanager
assert.Len(topo.Alertmanager, 1)
aler := topo.Alertmanager[0]
expectedAlter := spec.AlertManagerSpec{
assert.Len(topo.Alertmanagers, 1)
aler := topo.Alertmanagers[0]
expectedAlter := spec.AlertmanagerSpec{
Host: "172.19.0.101",
SSHPort: 22,
WebPort: 9093,
Expand All @@ -201,8 +201,8 @@ func TestImportFromAnsible(t *testing.T) {
assert.Equal(expectedAlter, aler)

// Check Grafana
assert.Len(topo.Grafana, 1)
grafana := topo.Grafana[0]
assert.Len(topo.Grafanas, 1)
grafana := topo.Grafanas[0]
expectedGrafana := spec.GrafanaSpec{
Host: "172.19.0.101",
SSHPort: 22,
Expand Down
2 changes: 1 addition & 1 deletion components/dm/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func Execute() {
}

if !errorx.HasTrait(err, errutil.ErrTraitPreCheck) {
logger.OutputDebugLog()
logger.OutputDebugLog("tiup-dm")
}

if errx := errorx.Cast(err); errx != nil {
Expand Down
2 changes: 1 addition & 1 deletion components/dm/command/scale_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func newScaleInCmd() *cobra.Command {
// ScaleInDMCluster scale in dm cluster.
func ScaleInDMCluster(
getter operator.ExecutorGetter,
topo *dm.Topology,
topo *dm.Specification,
options operator.Options,
) error {
// instances by uuid
Expand Down
173 changes: 0 additions & 173 deletions components/dm/spec/alertmanager.go

This file was deleted.

2 changes: 1 addition & 1 deletion components/dm/spec/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/pingcap/tiup/pkg/cluster/spec"
// DMComponentVersion maps the dm version to the third components binding version
func DMComponentVersion(comp, version string) string {
switch comp {
case spec.ComponentAlertManager:
case spec.ComponentAlertmanager:
return "v0.17.0"
case spec.ComponentGrafana, spec.ComponentPrometheus:
return "v4.0.3"
Expand Down
Loading

0 comments on commit 75553c1

Please sign in to comment.