INNER CODE UNIT · Go

RunTiCDCPrestopHook

pingcap/tidb-operator · cmd/prestop-checker/main.go:225

func RunTiCDCPrestopHook(ctx context.Context, cfg *TiCDCConfig) error {
	fmt.Println("run ticdc prestop hook")
	if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (done bool, err error) {
		fmt.Println("try to resign owner")
		resigned, err := cfg.Client.ResignOwner(ctx)
		if err != nil {
			return false, err
		}
		if !resigned {
			fmt.Println("wait for resigning owner")
			return false, nil
		}

		fmt.Println("try to drain capture")
		tableCount, err := cfg.Client.DrainCapture(ctx)
		if err != nil {
			return false, err
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…