Bug 1958972

Summary: [SCALE] deadlock in ovn-kube when scaling up to 300 nodes
Product: OpenShift Container Platform Reporter: Tim Rozet <trozet>
Component: NetworkingAssignee: Tim Rozet <trozet>
Networking sub component: ovn-kubernetes QA Contact: Kedar Kulkarni <kkulkarn>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: astoycos, kkulkarn, mifiedle, nelluri
Version: 4.8Flags: kkulkarn: needinfo-
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: perfscale-ovn
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1960057 (view as bug list) Environment:
Last Closed: 2021-07-27 23:07: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: 1960057    
Attachments:
Description Flags
ovnkube master log with stack trace none

Description Tim Rozet 2021-05-10 14:11:20 UTC
Description of problem:
We switched in 4.8 to use the new services controller for endpoint slices. However when a node is added it tries to sync services using the old controller. There is deadlock here around the services cache we hold using the old controller:

goroutine 1330 [semacquire]:
sync.runtime_SemacquireMutex(0xc000ba0f9c, 0x0, 0x1)
	/usr/lib/golang/src/runtime/sema.go:71 +0x47
sync.(*Mutex).lockSlow(0xc000ba0f98)
	/usr/lib/golang/src/sync/mutex.go:138 +0x105
sync.(*Mutex).Lock(...)
	/usr/lib/golang/src/sync/mutex.go:81
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).removeServiceLB(0xc000ba0e00, 0xc022db8d50, 0x24, 0xc023eecd60, 0x11)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/ovn.go:1117 +0xf6
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).deleteLoadBalancerVIP(0xc000ba0e00, 0xc022db8d50, 0x24, 0xc023eecd60, 0x11, 0x0, 0x0)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/loadbalancer.go:72 +0x3fe
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).deleteServiceFromIdlingBalancer(0xc000ba0e00, 0xc0016b76c0)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/service.go:299 +0x37a
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).AddEndpoints(0xc000ba0e00, 0xc001901300, 0x0, 0xc024c3bbc0, 0x2)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/endpoints.go:75 +0x3a5
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).handleNodePortLB(0xc000ba0e00, 0xc000a06540, 0xc036048e60, 0xa)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/endpoints.go:166 +0x125
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).syncGatewayLogicalNetwork(0xc000ba0e00, 0xc000a06540, 0xc034951200, 0xc017798670, 0x1, 0x1, 0xc021a79680, 0xc0253cd2f0, 0x24)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/master.go:702 +0xf19
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).syncNodeGateway(0xc000ba0e00, 0xc000a06540, 0xc017798670, 0x1, 0x1, 0x0, 0x0)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/ovn.go:926 +0xff
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/ovn.(*Controller).WatchNodes.func1(0x1bdb960, 0xc000a06540)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/ovn/ovn.go:970 +0x66c
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/vendor/k8s.io/client-go/tools/cache/controller.go:231
k8s.io/client-go/tools/cache.FilteringResourceEventHandler.OnAdd(0xc005b792c0, 0x1e79ce0, 0xc00590d5a0, 0x1bdb960, 0xc000a06540)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/vendor/k8s.io/client-go/tools/cache/controller.go:264 +0x6a
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/factory.(*Handler).OnAdd(...)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/factory/handler.go:38
github.com/ovn-org/ovn-kubernetes/go-controller/pkg/factory.newQueuedInformer.func1.1(0xc009bb0450, 0xc005dfaa20, 0xc005dff260)
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/factory/handler.go:367 +0xaf
created by github.com/ovn-org/ovn-kubernetes/go-controller/pkg/factory.newQueuedInformer.func1
	/go/src/github.com/openshift/ovn-kubernetes/go-controller/pkg/factory/handler.go:360 +0x10a

Comment 1 Tim Rozet 2021-05-10 14:29:56 UTC
Created attachment 1781723 [details]
ovnkube master log with stack trace

Comment 2 Tim Rozet 2021-05-10 14:30:37 UTC
4.8 solution to this is to stop using the old endpoints/services controller and only use the new controller

Comment 3 Mohamed Mahmoud 2021-05-12 19:06:21 UTC
*** Bug 1947861 has been marked as a duplicate of this bug. ***

Comment 6 Mike Fiedler 2021-06-10 16:21:09 UTC
Marking this bug verified based on successful verification of https://bugzilla.redhat.com/show_bug.cgi?id=1958958 at 300 nodes and 15000 pods on 4.8.0-0.nightly-2021-06-09-095212

Comment 9 errata-xmlrpc 2021-07-27 23:07:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438