当前位置:网站首页>too old resource version,Code:410
too old resource version,Code:410
2022-06-13 02:28:00 【Matthew__ M】
object="&Status{ListMeta:ListMeta{SelfLink:,
ResourceVersion:,Continue:,RemainingItemCount:nil,},
Status:Failure,Message:too old resource version: 81
006768 (81242378),Reason:Expired,Details:nil,Code:410,}"
I encountered... When writing code today too old resourceversion This problem ,
• Reasons for screening
Not specified ResourceVersion, Default empty string .kube-apiserver After receiving a read request of this type , It will be to etcd Send a consensus to read / Linear read request acquisition etcd The latest data of the cluster .
ResourceVersion="0", Assignment string 0.kube-apiserver When such a request is received , It may return data of any resource version number , However, the newer version is preferred . In general, it comes directly from kube-apiserver Get the data returned to the cache client, It is possible to read expired data , It is applicable to scenarios that do not require high data consistency .
ResourceVersion For a non 0 String .kube-apiserver When such a request is received , It will guarantee Cache The latest in ResourceVersion Greater than or equal to your incoming ResourceVersion, And then from Cache Find the resource object you requested in key, Return data to client. The basic principle is kube-apiserver For each core resource ( Such as Pod) One was maintained Cache, adopt etcd Of Watch Mechanism to update in real time Cache. When your Get The request carries non 0 Of ResourceVersion, It waits for the latest... In the cache ResourceVersion Greater than or equal to you Get In the request ResoureVersion, If the conditions are met, start from Cache Query data in , Return to client. If the conditions are not met , It waits at most 3 second , If more than 3 second ,Cache The latest in ResourceVersion Less than Get In the request ResourceVersion, It will return ResourceVersionTooLarge Wrong to client.
etcd Default hold 5 Change records within minutes , Each resource change will update a larger resource version ResourceVersion,ResourceVersion Is a global variable shared by all resource types .
about watch The request for , You can designate a resourceVersion=0 To get 5 Records of any changes within minutes and thereafter , This kind of behavior is very strange , Therefore, it is not recommended to specify 0. You can specify one resourceVersion To get the change records after the resource version , But this resource version is older than 5 Minimum version retained within minutes , Will reply with 410 Status code , If greater than the maximum version , You may have to wait , Until timeout .\
• The trigger condition
Service creation exceeds etcd The cluster is saved by default cache After time , If the service comes in resourceversion Version of is earlier than etcd The minimum version retained within the default save time , It will trigger 410(status code), trigger too old resource version.
• resolvent
Upon receipt of 410 statuscode When , Error handling , again rewatch Again 、 Go straight to the code :
retry := 0
reWatch:
ch, err := kubeclient.KubeClient.AppsV1().StatefulSets(sts.ObjectMeta.Namespace).Watch(context.TODO(),
metav1.SingleObject(metav1.ObjectMeta{Name: sts.ObjectMeta.Name, ResourceVersion: resourceVersion}))
if err != nil {
if apierrors.IsGone(err) {
tlog.Error(err, "watch resource is gone", "err is:", sts.Name)
resourceVersion = ""
retry++
if retry < 3 {
goto reWatch
}
}
tlog.Error(err, "cannot watch resource:%v", "err is:", sts.Name)
return
}
边栏推荐
- Superficial understanding of conditional random fields
- [learning notes] xr872 GUI littlevgl 8.0 migration (file system)
- Queuing theory, game theory, analytic hierarchy process
- ROS learning-7 error in custom message or service reference header file
- Test questions basic exercise 01 string
- [reading papers] comparison of deeplobv1-v3 series, brief review
- Graph theory, tree based concept
- Gadgets: color based video and image cutting
- Sqlserver2008 denied select permission on object'***** '(database'*****', schema'dbo')
- Laptop touch pad operation
猜你喜欢
[reading paper] generate confrontation network Gan
Installing Oracle with docker for Mac
拍拍贷母公司信也季报图解:营收24亿 净利5.3亿同比降10%
柏瑞凱電子沖刺科創板:擬募資3.6億 汪斌華夫婦為大股東
Huawei equipment is configured with dual reflectors to optimize the backbone layer of the virtual private network
0- blog notes guide directory (all)
What are the differences in cache/tlb?
4.11 introduction to firmware image package
Flow chart of interrupt process
C language compressed string is saved to binary file, and the compressed string is read from binary file and decompressed.
随机推荐
Superficial understanding of conditional random fields
What are the differences in cache/tlb?
[reading paper] generate confrontation network Gan
Build MySQL environment under mac
redis.conf总配置详解
【Unity】打包WebGL项目遇到的问题及解决记录
Mac使用Docker安装Oracle
Paper reading - jukebox: a generic model for music
1000粉丝啦~
Chapter7-11_ Deep Learning for Question Answering (2/2)
Basic principle of bilateral filtering
Is space time attention all you need for video understanding?
Impossible d'afficher le contenu de la base de données après que l'idée a utilisé le pool de connexion c3p0 pour se connecter à la base de données SQL
Area of basic exercise circle ※
Number of special palindromes in basic exercise of test questions
Swiper horizontal rotation grid
[reading papers] deep learning face representation by joint identification verification, deep learning applied to optimization problems, deepid2
Understand speech denoising
Classification and summary of system registers in aarch64 architecture of armv8/arnv9
Laravel permission export