Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1848939

Summary: [DR]etcd fail to back after restore from automated-cluster-backups
Product: OpenShift Container Platform Reporter: ge liu <geliu>
Component: kube-apiserverAssignee: Abu Kashem <akashem>
Status: CLOSED WONTFIX QA Contact: Ke Wang <kewang>
Severity: high Docs Contact:
Priority: low    
Version: 4.5CC: mfojtik, nstielau, rphillips, sttts, wking, xxia
Target Milestone: ---Flags: mfojtik: needinfo?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: tag-ci LifecycleStale
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1850687 (view as bug list) Environment:
Last Closed: 2023-01-16 11:29:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1850687    

Comment 6 Sam Batschelet 2020-06-19 17:54:11 UTC
After review the reported status of the etcd mirror pod post DR recovery was stale.

```
$ oc get pods -n openshift-etcd
{"level":"debug","ts":"2020-06-19T11:34:54.422-0400","caller":"balancer/balancer.go:60","msg":"registered balancer","policy":"picker-roundrobin-balanced","name":"etcd-picker-roundrobin-balanced"}
NAME                                                           READY   STATUS      RESTARTS   AGE
etcd-ip-10-0-139-35.us-east-2.compute.internal                 4/4     Running     2          6h56m
etcd-ip-10-0-172-33.us-east-2.compute.internal                 1/1     Running     0          162m
etcd-ip-10-0-204-230.us-east-2.compute.internal                4/4     Running     0          161m
```

Kubelet was reporting that pod etcd-ip-10-0-139-35.us-east-2.compute.internal was Ready but it was not. etcd was actually not running on this node. A secondary problem was because cluster-etcd-operator relies on Pod status to conclude[1] when scaling is required it was never scaled up. After speaking with node team we believe the issue could be related to a known upstream issue[2]. Operators etc rely on accurate status reporting of Pods, while it is understandable that time travel can cause unexpected state corner cases. We expect the API to reconcile static pod status. Currently, we are reviewing if we can document a workaround for DR.


[1] https://github.com/openshift/cluster-etcd-operator/blob/release-4.5/pkg/operator/clustermembercontroller/clustermembercontroller.go#L145
[2] https://github.com/kubernetes/kubernetes/pull/89155

Comment 7 Sam Batschelet 2020-06-19 19:21:30 UTC
Moving to node team to further triage. DR is an important part of OCP leaving this as high priority as we should not ship with broken DR.

Comment 19 Seth Jennings 2020-08-10 16:06:20 UTC
Ryan is on leave

Comment 20 Seth Jennings 2020-08-10 20:43:56 UTC
Is this still an issue?

Comment 21 Seth Jennings 2020-08-12 16:36:30 UTC
disruptive tests are completely failing right now
https://deck-ci.apps.ci.l2s4.p1.openshiftapps.com/?job=*disruptive

recent runs of presubmit on etcd-operator PRs
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-etcd-operator/420/pull-ci-openshift-cluster-etcd-operator-master-e2e-aws-disruptive/1293302526090678272
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-etcd-operator/405/pull-ci-openshift-cluster-etcd-operator-master-e2e-aws-disruptive/1293236449713328128
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-etcd-operator/397/pull-ci-openshift-cluster-etcd-operator-master-e2e-aws-disruptive/1293231460957818880

2 of the 3 fail with

fail [github.com/openshift/origin@/test/extended/dr/quorum_restore.go:100]: Unexpected error:
    <*errors.StatusError | 0xc0016b6460>: {
        ErrStatus: {
            TypeMeta: {Kind: "", APIVersion: ""},
            ListMeta: {
                SelfLink: "",
                ResourceVersion: "",
                Continue: "",
                RemainingItemCount: nil,
            },
            Status: "Failure",
            Message: "deployments/scale.apps \"etcd-quorum-guard\" not found",
            Reason: "NotFound",
            Details: {
                Name: "etcd-quorum-guard",
                Group: "apps",
                Kind: "deployments/scale",
                UID: "",
                Causes: nil,
                RetryAfterSeconds: 0,
            },
            Code: 404,
        },
    }
    deployments/scale.apps "etcd-quorum-guard" not found
occurred

Comment 22 Seth Jennings 2020-08-12 17:09:48 UTC
https://github.com/kubernetes/kubernetes/pull/89155 is the alleged fix for this.

Sam reports they have a workaround, reducing severity.

I would also be interested to is if https://github.com/kubernetes/kubernetes/pull/92442 had any impact on this situation.  It is included in 4.6 now.

Comment 23 Seth Jennings 2020-08-12 19:32:28 UTC
Talking to Sam, Suresh and Clayton about this, this is a single example of a much larger problem of etcd going back in time and list watchers not being notified or able to handling going back in time.

In particular, once the kubelet deletes a pod, it will not attempt to redelete it (because it has no idea it exist on the apiserver because it doesn't trigger the watcher) unless it is restarted and does a full relist and reconciliation.

Not sure what the future is for this bug since it is an issue much more fundamental and systemic to kube that just this situation.

etcd team does have a workaround for this however, restarting the kubelet currently and possibly moving to manual deletion of the stale mirror pod.

Only element that I have yet to understand (or the only one I know I don't know) is why this worked in 4.4 but not 4.5.

Comment 24 Seth Jennings 2020-08-17 16:30:47 UTC
From conversation with Clayton

===
i think hard failure is the only acceptable outcome

the question is how we patch it sanely in all componets

the DR test can verify it fixes kubelet

seth can you try a quick hack PR that os.Exits(1) if lister watcher detects a stitch in time (i think it prints an error today???)

and we can run disurptive on it with cluster bot and see

it'll be in client-go

one sec

reflector.go in client-go/tools/cache

ListAndWatch()

do the following

try to convert resourceVersion to int, if you can, compare to the previous avlue

if going back in time, klog.Fatalf
===

This likely something that will not be done in the 4.6 timeframe as it will take time to validate that every user of client-go does the Right Thing with this new behavior.  If this fix goes through, it will likely not be done by the Node team as we do not own client-go.

Comment 25 Seth Jennings 2020-08-17 16:41:07 UTC
Sending to apiserver for comments and experimenting with the change to client-go

Comment 26 Abu Kashem 2020-09-10 21:44:32 UTC
I’m adding UpcomingSprint, because I was occupied by fixing bugs with higher priority/severity, developing new features with higher priority, or developing new features to improve stability at a macro level. We will revisit this in a future sprint.

(It's targeted for 4.7)

Comment 27 Michal Fojtik 2020-09-16 17:28:08 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 28 Sam Batschelet 2020-10-08 15:51:34 UTC
@Abut this is blocking DR working properly I bumped the severity to high, please reach out if you have questions around Seths questions.

Comment 29 Michal Fojtik 2020-10-08 16:04:13 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 30 Abu Kashem 2020-10-25 15:19:58 UTC
Hi sbatsche, 
I am planning to address it this sprint. I will connect with you to get more details.

Comment 31 Abu Kashem 2020-11-13 16:02:55 UTC
work is in progress, trying to setup an integration test to reproduce the issue.
https://github.com/openshift/kubernetes/pull/453

Comment 32 Michal Fojtik 2020-12-13 16:30:35 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 34 Michal Fojtik 2021-01-20 19:20:27 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 35 Abu Kashem 2021-02-03 22:14:16 UTC
> work is in progress, trying to setup an integration test to reproduce the issue.
> https://github.com/openshift/kubernetes/pull/453

I will collaborate with Maru o this in 4.8

Comment 36 Michal Fojtik 2021-03-05 22:26:52 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 37 W. Trevor King 2021-03-15 17:00:12 UTC
Close as a dup of bug 1886160?  That was filed later, but it's what the PRs got attached to.

Comment 38 Michal Fojtik 2021-03-15 17:07:27 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 39 Michal Fojtik 2021-04-14 17:57:37 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 41 Michal Fojtik 2021-05-06 03:14:34 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 43 Stefan Schimanski 2021-05-20 16:05:48 UTC
We don't have a shared client-go today, and I don't believe it's a good idea to start one.

What would be a reasonable way to have that in upstream? export KUBERNETES_EXIT_ON_TIMETRAVEL=1 ?

Comment 44 Michal Fojtik 2021-06-19 16:29:42 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 46 Michal Fojtik 2021-07-06 04:13:29 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 47 Michal Fojtik 2021-08-05 04:47:09 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Keywords if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 50 Michal Fojtik 2022-01-08 05:52:32 UTC
The LifecycleStale keyword was removed because the bug got commented on recently.
The bug assignee was notified.

Comment 51 Michal Fojtik 2022-02-07 06:23:16 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Whiteboard if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 55 Michal Fojtik 2023-01-16 11:29:46 UTC
Dear reporter, we greatly appreciate the bug you have reported here. Unfortunately, due to migration to a new issue-tracking system (https://issues.redhat.com/), we cannot continue triaging bugs reported in Bugzilla. Since this bug has been stale for multiple days, we, therefore, decided to close this bug.

If you think this is a mistake or this bug has a higher priority or severity as set today, please feel free to reopen this bug and tell us why. We are going to move every re-opened bug to https://issues.redhat.com. 

Thank you for your patience and understanding.