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

Optimize WAL verification #155

Merged
merged 1 commit into from
May 7, 2019

Conversation

shreyas-s-rao
Copy link
Collaborator

@shreyas-s-rao shreyas-s-rao commented May 3, 2019

Signed-off-by: Shreyas Rao [email protected]

What this PR does / why we need it:
This PR optimizes WAL verification memory usage by utilizing the recently added wal.Verify() feature in etcd 3.3.13.

Which issue(s) this PR fixes:
Fixes #120

Special notes for your reviewer:

Release note:

Optimized WAL verification memory usage.
Updated etcd vendoring version to 3.3.13.

Signed-off-by: Shreyas Rao <[email protected]>
@shreyas-s-rao shreyas-s-rao added kind/enhancement Enhancement, improvement, extension needs/review Needs review component/etcd-backup-restore ETCD Backup & Restore platform/all needs/lgtm Needs approval for merging area/performance Performance (across all domains, such as control plane, networking, storage, etc.) related needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 3, 2019
@shreyas-s-rao shreyas-s-rao added this to the 1904b milestone May 3, 2019
@shreyas-s-rao shreyas-s-rao requested a review from swapnilgm May 3, 2019 09:37
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 3, 2019
@shreyas-s-rao
Copy link
Collaborator Author

shreyas-s-rao commented May 3, 2019

@swapnilgm @amshuman-kr

I have also run memory profiling for master and this PR, to visualize the reduction in memory usage and time taken for data validation.

Master - uses wal package's ReadAll() method
Screen Shot 2019-05-03 at 4 07 58 PM

This PR - uses wal package's new Verify() function
Screen Shot 2019-05-03 at 4 08 27 PM

The test has been run on a 700MB DB size with a 1.3GB wal dir size (2GB total data dir size). As you can see, the memory usage has drastically dropped (from linear increase till 2GB to a steady usage of 7MB and within max 15MB), and is now independent of wal dir size. Also, the time taken for wal verification has drastically reduced (from 3s to less than 1s).

Copy link
Contributor

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for updating upstream etcd.

@swapnilgm swapnilgm merged commit dac6834 into gardener:master May 7, 2019
@shreyas-s-rao shreyas-s-rao deleted the optimize-wal-verification branch May 7, 2019 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance Performance (across all domains, such as control plane, networking, storage, etc.) related component/etcd-backup-restore ETCD Backup & Restore kind/enhancement Enhancement, improvement, extension needs/lgtm Needs approval for merging needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review platform/all
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory optimizations during data verification
3 participants