external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

external-dns 0.14.0 with DynamoDB Registry: panic with large set of records

Open willhughes-au opened this issue 1 year ago • 2 comments

What happened:

We have a number of EKS clusters, each with multiple external-dns deployments.

These deployments have been running successfully for some period using the default TXT registry.

We are in the process of moving over to the DynamoDB registry. Testing was successful on deployments with a small number of zones and small set of records.

When migrating a deployment with 10 zones, and about 300 records, external-dns started crashing with a panic:

panic: runtime error: slice bounds out of range [:25] with capacity 0

goroutine 1 [running]:
sigs.k8s.io/external-dns/registry.(*DynamoDBRegistry).executeStatements(0xc000b982d0, {0x3ddbc28, 0xc001f5e000}, {0xc001cfd080?, 0x0?, 0x0?}, 0xc0020de6a8)
	sigs.k8s.io/external-dns/registry/dynamodb.go:481 +0x305
sigs.k8s.io/external-dns/registry.(*DynamoDBRegistry).ApplyChanges(0xc000b982d0, {0x3ddbc28, 0xc001f5e000}, 0xc001f44120)
	sigs.k8s.io/external-dns/registry/dynamodb.go:286 +0xe51
sigs.k8s.io/external-dns/controller.(*Controller).RunOnce(0xc00191b860, {0x3ddbc60, 0xc000a66370})
	sigs.k8s.io/external-dns/controller/controller.go:250 +0x6fa
sigs.k8s.io/external-dns/controller.(*Controller).Run(0xc00191b860?, {0x3ddbc60, 0xc000a66370})
	sigs.k8s.io/external-dns/controller/controller.go:333 +0xaf
main.main()
	sigs.k8s.io/external-dns/main.go:475 +0x4a4f

This appears to crash on the first batch, as nothing has yet been written to DynamoDB, even after multiple panics.

What you expected to happen:

Should not panic.

How to reproduce it (as minimally and precisely as possible):

Have an existing external-dns deployment configured, with more than 25 records (the DynamoDB Batch size is 25)

Anything else we need to know?:

Environment: EKS Nodes on EC2

  • External-DNS version (use external-dns --version): image registry.k8s.io/external-dns/external-dns:v0.14.0
  • DNS provider: AWS Route53
  • Others: Helm chart version 1.14.3

willhughes-au avatar Feb 21 '24 05:02 willhughes-au

This was fixed in https://github.com/kubernetes-sigs/external-dns/pull/4021 but is not yet included in a release.

jamesmcminn96 avatar Feb 25 '24 03:02 jamesmcminn96

This was fixed in #4021 but is not yet included in a release.

Ok, thanks for that confirmation -- given that's quite a while ago, is there any indication on when it'll be released?

willhughes-au avatar Feb 25 '24 03:02 willhughes-au

Resolved with v0.14.1 https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.14.1

willhughes-au avatar Apr 08 '24 04:04 willhughes-au