Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Sep 22, 2022
2 parents f9695cc + 0be11e9 commit 8b0dd4f
Show file tree
Hide file tree
Showing 88 changed files with 2,441 additions and 279 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand All @@ -41,14 +41,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/integrate-cluster-cmd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ jobs:
# - 'test_cmd_tls_native_ssh'
- 'test_upgrade'
- 'test_upgrade_tls'
- 'test_tikv_cdc'
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integrate-cluster-scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integrate-dm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integrate-playground.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/integrate-tiup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down Expand Up @@ -85,15 +85,15 @@ jobs:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}

- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: make unit-test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-tiup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
env:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.git-ref || github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reprotest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
strategy:
matrix:
go:
- 1.18.x
- 1.19.x

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
TiUP Changelog

## [1.10.3] 2022-08-11

### Mirror update

- Add new version for node_exporter (https://github.com/prometheus/node_exporter/releases/tag/v1.3.1) and blackbox_exporter (https://github.com/prometheus/blackbox_exporter/releases/tag/v0.21.1) in tiup repository. All the new tidb clusters or instances deployed by tiup cluster will use the new version by default.
### Fixes

- Fix cannot clean related tidb topology after scale-in in `tiup-cluster` ([#2011](https://github.com/pingcap/tiup/pull/2011), [@nexustar](https://github.com/nexustar))
- Fix fail to push if server name has "-" in `tiup-cluster` ([#2008](https://github.com/pingcap/tiup/pull/2008), [@nexustar](https://github.com/nexustar))
- Fix unable to configure tiflash LearnerConfig in `tiup-cluster` ([#1991](https://github.com/pingcap/tiup/pull/1991), [@srstack](https://github.com/srstack))

### Improvements

- Improve the THP check rule in `tiup-cluster` ([#2014](https://github.com/pingcap/tiup/pull/2014), [@nexustar](https://github.com/nexustar))
- Add an example in -h for `tiup mirror clone` for multiple versions ([#2009](https://github.com/pingcap/tiup/pull/2009), [@nexustar](https://github.com/nexustar))

## [1.10.2] 2022-06-16

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ tools/bin/revive: tools/check/go.mod

tools/bin/golangci-lint:
@# Target: pull in specific version of golangci-lint (v1.42.1)
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./tools/bin v1.45.0
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./tools/bin v1.49.0
3 changes: 2 additions & 1 deletion cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ func newMirrorCloneCmd() *cobra.Command {
}
cmd := &cobra.Command{
Use: "clone <target-dir> [global version]",
Example: ` tiup mirror clone /path/to/local --arch amd64,arm --os linux,darwin # Specify the architectures and OSs
Example: ` tiup mirror clone /path/to/local --arch amd64,arm64 --os linux,darwin # Specify the architectures and OSs
tiup mirror clone /path/to/local --os linux v6.1.0 v5.4.0 # Specify multiple versions
tiup mirror clone /path/to/local --full # Build a full local mirror
tiup mirror clone /path/to/local --tikv v4 --prefix # Specify the version via prefix
tiup mirror clone /path/to/local --tidb all --pd all # Download all version for specific component`,
Expand Down
2 changes: 1 addition & 1 deletion components/cluster/command/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra"
)

// retainDay number of days to keep audit logs for deletion
// retainDay number of days to keep audit logs for deletion
var retainDays int

func newAuditCmd() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion components/cluster/command/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newPatchCmd() *cobra.Command {
cmd.Flags().BoolVar(&overwrite, "overwrite", false, "Use this package in the future scale-out operations")
cmd.Flags().StringSliceVarP(&gOpt.Nodes, "node", "N", nil, "Specify the nodes")
cmd.Flags().StringSliceVarP(&gOpt.Roles, "role", "R", nil, "Specify the roles")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 300, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders, also for TiCDC drain one capture")
cmd.Flags().BoolVarP(&offlineMode, "offline", "", false, "Patch a stopped cluster")
return cmd
}
2 changes: 1 addition & 1 deletion components/cluster/command/reload.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func newReloadCmd() *cobra.Command {
cmd.Flags().BoolVar(&gOpt.Force, "force", false, "Force reload without transferring PD leader and ignore remote error")
cmd.Flags().StringSliceVarP(&gOpt.Roles, "role", "R", nil, "Only reload specified roles")
cmd.Flags().StringSliceVarP(&gOpt.Nodes, "node", "N", nil, "Only reload specified nodes")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 300, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders, also for TiCDC drain one capture")
cmd.Flags().BoolVarP(&gOpt.IgnoreConfigCheck, "ignore-config-check", "", false, "Ignore the config check result")
cmd.Flags().BoolVar(&skipRestart, "skip-restart", false, "Only refresh configuration to remote and do not restart services")

Expand Down
2 changes: 1 addition & 1 deletion components/cluster/command/scale_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func newScaleInCmd() *cobra.Command {
}

cmd.Flags().StringSliceVarP(&gOpt.Nodes, "node", "N", nil, "Specify the nodes (required)")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 300, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders, also for TiCDC drain one capture")
cmd.Flags().BoolVar(&gOpt.Force, "force", false, "Force just try stop and destroy instance before removing the instance from topo")

_ = cmd.MarkFlagRequired("node")
Expand Down
2 changes: 1 addition & 1 deletion components/cluster/command/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func newUpgradeCmd() *cobra.Command {
},
}
cmd.Flags().BoolVar(&gOpt.Force, "force", false, "Force upgrade without transferring PD leader")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders")
cmd.Flags().Uint64Var(&gOpt.APITimeout, "transfer-timeout", 600, "Timeout in seconds when transferring PD and TiKV store leaders, also for TiCDC drain one capture")
cmd.Flags().BoolVarP(&gOpt.IgnoreConfigCheck, "ignore-config-check", "", false, "Ignore the config check result")
cmd.Flags().BoolVarP(&offlineMode, "offline", "", false, "Upgrade a stopped cluster")

Expand Down
5 changes: 3 additions & 2 deletions components/dm/command/scale_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func ScaleInDMCluster(
continue
}
instCount[instance.GetHost()]--
if err := operator.StopAndDestroyInstance(ctx, topo, instance, options, instCount[instance.GetHost()] == 0); err != nil {
if err := operator.StopAndDestroyInstance(ctx, topo, instance, options, false, instCount[instance.GetHost()] == 0, tlsCfg); err != nil {
log.Warnf("failed to stop/destroy %s: %v", component.Name(), err)
}
}
Expand Down Expand Up @@ -155,7 +155,8 @@ func ScaleInDMCluster(
topo,
[]dm.Instance{instance},
noAgentHosts,
options.OptTimeout,
options,
false,
false, /* evictLeader */
&tls.Config{}, /* not used as evictLeader is false */
); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions components/playground/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func buildCommands(tp CommandType, opt *BootOptions) (cmds []Command) {
{"tiflash", opt.TiFlash},
{"tidb", opt.TiDB},
{"ticdc", opt.TiCDC},
{"tikv-cdc", opt.TiKVCDC},
{"drainer", opt.Drainer},
}

Expand Down Expand Up @@ -98,6 +99,7 @@ func newScaleOut() *cobra.Command {
cmd.Flags().IntVarP(&opt.PD.Num, "pd", "", opt.PD.Num, "PD instance number")
cmd.Flags().IntVarP(&opt.TiFlash.Num, "tiflash", "", opt.TiFlash.Num, "TiFlash instance number")
cmd.Flags().IntVarP(&opt.TiCDC.Num, "ticdc", "", opt.TiCDC.Num, "TiCDC instance number")
cmd.Flags().IntVarP(&opt.TiKVCDC.Num, "kvcdc", "", opt.TiKVCDC.Num, "TiKV-CDC instance number")
cmd.Flags().IntVarP(&opt.Pump.Num, "pump", "", opt.Pump.Num, "Pump instance number")
cmd.Flags().IntVarP(&opt.Drainer.Num, "drainer", "", opt.Pump.Num, "Drainer instance number")

Expand All @@ -116,6 +118,7 @@ func newScaleOut() *cobra.Command {
cmd.Flags().StringVarP(&opt.PD.BinPath, "pd.binpath", "", opt.PD.BinPath, "PD instance binary path")
cmd.Flags().StringVarP(&opt.TiFlash.BinPath, "tiflash.binpath", "", opt.TiFlash.BinPath, "TiFlash instance binary path")
cmd.Flags().StringVarP(&opt.TiCDC.BinPath, "ticdc.binpath", "", opt.TiCDC.BinPath, "TiCDC instance binary path")
cmd.Flags().StringVarP(&opt.TiKVCDC.BinPath, "kvcdc.binpath", "", opt.TiKVCDC.BinPath, "TiKVCDC instance binary path")
cmd.Flags().StringVarP(&opt.Pump.BinPath, "pump.binpath", "", opt.Pump.BinPath, "Pump instance binary path")
cmd.Flags().StringVarP(&opt.Drainer.BinPath, "drainer.binpath", "", opt.Drainer.BinPath, "Drainer instance binary path")

Expand Down
1 change: 1 addition & 0 deletions components/playground/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Config struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
UpTimeout int `yaml:"up_timeout"`
Version string `yaml:"version"`
}

type instance struct {
Expand Down
86 changes: 86 additions & 0 deletions components/playground/instance/tikv_cdc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright 2022 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package instance

import (
"context"
"fmt"
"path/filepath"
"strings"

tiupexec "github.com/pingcap/tiup/pkg/exec"
"github.com/pingcap/tiup/pkg/utils"
)

// TiKVCDC represent a TiKV-CDC instance.
type TiKVCDC struct {
instance
pds []*PDInstance
Process
}

var _ Instance = &TiKVCDC{}

// NewTiKVCDC create a TiKVCDC instance.
func NewTiKVCDC(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *TiKVCDC {
tikvCdc := &TiKVCDC{
instance: instance{
BinPath: binPath,
ID: id,
Dir: dir,
Host: host,
Port: utils.MustGetFreePort(host, 8600),
ConfigPath: configPath,
},
pds: pds,
}
tikvCdc.StatusPort = tikvCdc.Port
return tikvCdc
}

// Start implements Instance interface.
func (c *TiKVCDC) Start(ctx context.Context, version utils.Version) error {
endpoints := pdEndpoints(c.pds, true)

args := []string{
"server",
fmt.Sprintf("--addr=%s:%d", c.Host, c.Port),
fmt.Sprintf("--advertise-addr=%s:%d", AdvertiseHost(c.Host), c.Port),
fmt.Sprintf("--pd=%s", strings.Join(endpoints, ",")),
fmt.Sprintf("--log-file=%s", c.LogFile()),
fmt.Sprintf("--data-dir=%s", filepath.Join(c.Dir, "data")),
}
if c.ConfigPath != "" {
args = append(args, fmt.Sprintf("--config=%s", c.ConfigPath))
}

var err error
if c.BinPath, err = tiupexec.PrepareBinary("tikv-cdc", version, c.BinPath); err != nil {
return err
}
c.Process = &process{cmd: PrepareCommand(ctx, c.BinPath, args, nil, c.Dir)}

logIfErr(c.Process.SetOutputFile(c.LogFile()))
return c.Process.Start()
}

// Component return component name.
func (c *TiKVCDC) Component() string {
return "tikv-cdc"
}

// LogFile return the log file.
func (c *TiKVCDC) LogFile() string {
return filepath.Join(c.Dir, "tikv_cdc.log")
}
Loading

0 comments on commit 8b0dd4f

Please sign in to comment.