Code Monkey home page Code Monkey logo

Comments (10)

csuzhangxc avatar csuzhangxc commented on July 23, 2024

pvcModifier.Sync is called after tikvMemberManager.Sync, is there any other log about why TiKV still in the Upgrade phase but without re-creating Pods?

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

And here are two things to be figure out

  1. Why I modify tikv config, but pods are not rolling?
  2. How can I fix these error message?

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

I found the reason are related to these codes
https://github.com/pingcap/tidb-operator/blob/master/pkg/manager/member/tikv_member_manager.go#L823-L831

	// Scaling takes precedence over upgrading.
	if tc.TiKVStsDesiredReplicas() != *set.Spec.Replicas {
		tc.Status.TiKV.Phase = v1alpha1.ScalePhase
	} else if upgrading && tc.Status.PD.Phase != v1alpha1.UpgradePhase {
		if !tc.IsComponentLeaderEvicting(v1alpha1.TiKVMemberType) { // skip upgrade if someone is evicting leader
			tc.Status.TiKV.Phase = v1alpha1.UpgradePhase
		}
	} else {
		tc.Status.TiKV.Phase = v1alpha1.NormalPhase
	}

upgrading is always true, so the tc.Status.TiKV.Phase can't be assgin v1alpha1.NormalPhase

The reason of upgrading == true is some pods' revision are not equal to cluster revision like tikv-1

Name:             kvstore-prod-video-at-tikv-1
Namespace:        di-kvstore
Priority:         0
Service Account:  default
Node:             x 
Start Time:       Fri, 15 Dec 2023 17:38:34 +0800
Labels:           app.kubernetes.io/component=tikv
                  app.kubernetes.io/instance=kvstore-prod-video-at
                  app.kubernetes.io/managed-by=tidb-operator
                  app.kubernetes.io/name=tidb-cluster
                  cluster=kvstore-prod-video-at
                  controller-revision-hash=kvstore-prod-video-at-tikv-6978bbb55d
                  env=prod
                  statefulset.kubernetes.io/pod-name=kvstore-prod-video-at-tikv-1
                  tidb.pingcap.com/cluster-id=7312730664965344747
                  tidb.pingcap.com/store-id=18

but now cluster revision is

    Stateful Set:
      Collision Count:      0
      Current Replicas:     12
      Current Revision:     kvstore-prod-video-at-tikv-77565ff546
      Observed Generation:  13
      Ready Replicas:       30
      Replicas:             30
      Update Revision:      kvstore-prod-video-at-tikv-77565ff546
      Updated Replicas:     12

from tidb-operator.

csuzhangxc avatar csuzhangxc commented on July 23, 2024

Modify tikv config, then scale out cluster, then restart some tikv pods.

How did you restart TiKV pods? have you applied another operation before the previous has been done?

What's the value of .Spec.UpdateStrategy.RollingUpdate.Partition for the TiKV StatefulSet now?

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

Modify tikv config, then scale out cluster, then restart some tikv pods.

How did you restart TiKV pods? have you applied another operation before the previous has been done?

What's the value of .Spec.UpdateStrategy.RollingUpdate.Partition for the TiKV StatefulSet now?

Oh, I found this error happened before I did these operations.

 Update Strategy:
    Rolling Update:
      Partition:  30

from tidb-operator.

csuzhangxc avatar csuzhangxc commented on July 23, 2024

could you try to update the partition field to the max ordinal of not updated pods to manually trigger update?

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

I found restart pod can update revision, can I manually restart all pods by using

    annotations:
      tidb.pingcap.com/restartedAt: 2020-04-20T12:00

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

But I still want to figure out why this error happened, is there any way to fix it?

from tidb-operator.

csuzhangxc avatar csuzhangxc commented on July 23, 2024

But I still want to figure out why this error happened, is there any way to fix it?

I think it may be caused by extra modification before the previous has been done, then the Revision and Partition of the StatefulSet is broken.

from tidb-operator.

Smityz avatar Smityz commented on July 23, 2024

fixed this problem after restarting cluster

from tidb-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.