Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve connection leak issue in S3 backup remote delete on versioned buckets #637

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

Feder1co5oave
Copy link
Contributor

I'm experiencing a connection leak issue on clickhouse-backup where the no. of open connections in the container grow by the thousands each time a 'remote delete' command on s3 is being executed. After a few days, the node would exhaust the TCP memory and drop almost all new TCP connections to it.

Clickhouse-backup version isaltinity/clickhouse-backup:2.1.3.
I'm running Clickhouse on EKS with Clickhouse operator, EKS AMI for arm64 1.25.7-20230406 with linux kernel 5.10.
I noticed that the number of created connections is roughly equal to the number of objects being deleted for that shard/day. My backups are uploaded to a versioned S3 bucket.

I believe the bug is in getObjectVersion(): s3.GetObject() actually retrieves the object's body, which create a new connection until you close it.

Use s3.GetObjectAttributes() (which is also cheaper than s3.GetObject) to retrieve the object's version.

/cc @Slach who kindly assisted in troubleshooting!

…ectAttributes() instead of s3.GetObject() to retrieve the object's version
@Slach Slach added this to the 2.2.2 milestone Apr 19, 2023
@Slach Slach merged commit af310a3 into Altinity:master Apr 19, 2023
@Feder1co5oave Feder1co5oave deleted the fix-s3-connection-leak branch April 20, 2023 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants