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

release-20.2: colmem: limit batches of dynamic size by workmem in memory footprint #60571

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #59851.

/cc @cockroachdb/release


This commit adds a minor improvement to ResetMaybeReallocate method so
that it reuses the old batch (without doubling the capacity and
allocating a new batch) when the old batch has enough capacity and
reached the provided limit in size. This change effectively allows us to
limit all batches flowing through the vectorized engine by workmem
setting in size since the main batch-producers (cfetcher and
columnarizer) use this method.

Addresses: https://github.com/cockroachlabs/support/issues/808.

Release note (sql change): Most batches of data flowing through the
vectorized execution engine will now be limited in size by
sql.distsql.temp_storage.workmem (64MiB by default) which should
improve the stability of CockroachDB clusters.

This commit adds a minor improvement to `ResetMaybeReallocate` method so
that it reuses the old batch (without doubling the capacity and
allocating a new batch) when the old batch has enough capacity and
reached the provided limit in size. This change effectively allows us to
limit all batches flowing through the vectorized engine by `workmem`
setting in size since the main batch-producers (cfetcher and
columnarizer) use this method.

Release note (sql change): Most batches of data flowing through the
vectorized execution engine will now be limited in size by
`sql.distsql.temp_storage.workmem` (64MiB by default) which should
improve the stability of CockroachDB clusters.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

We probably will want to include 629a5f1 into this backport too.

Copy link
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)

@yuzefovich
Copy link
Member Author

I think I'll briefly hold off on merging this for two reasons:

  • so that the change bakes on master for a bit (the next 20.2 release starts on February 24th)
  • and so that we can see which minor tweaks with regards to testing limits should be included.

@yuzefovich
Copy link
Member Author

I haven't seen any fallout from recent work on making dynamic batch size based on memory usage, so I'll go ahead and merge it and will open up a few other backports with fixes too.

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

3 participants