-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
kv: performance regression due to new call to collectSpansRead
#91374
Comments
This commit adds `Release` calls for both SpanSets returned by `collectSpansRead` on the optimistic eval validation path. The failure to recycle these SpanSets was causing a leak from the `SpanSet` memory pool of both top level objects and the recycled inner slices. We have the same issue at the other caller of `collectSpansRead`, which is being tracked more broadly in cockroachdb#91374. Release note: None Epic: None
My bad on not picking up on the potential for regression here. I have a meta question: is there anything we can do at the CI level that would flag these kinds of regressions in microbenchmarks? As it stands, it's way too easy to introduce these regressions in the read/write eval path and nothing that tells the PR author about them. |
Computing in constant memory seems fine with the previous approach. Lazily evaluating the boundaries inside the decider, which would only be once initiated is a great idea. |
90709: sql/schemachanger: inject DML statements into end to end tests r=fqazi a=fqazi Fixes: #83304 Previously, the declarative schema changer tests only ran DDL statements for the schema change and had no mechanism for determining correct behaviour if queries were run concurrently at each phase. To address this, this patch adds a new framework to these tests which allows us to inject DML (inserts / selects) at various stages of a declarative schema change. This gives us a more powerful framework for validating behaviour. Release note: None The first commit here can be ignored, and its a separate PR to make sure this runs stable. A PR is already open for it. 91045: kvserver: separate repl q decision from action r=nvanbenschoten a=kvoli Same as #90529. with a fix to stop logging an error on replicate queue metrics unsupported action. ``` dev test pkg/cli -f TestPartialZip -v --stress --race ... 1135 runs so far, 0 failures, over 2m55s 1168 runs so far, 0 failures, over 3m0s ``` Previously, the replicate queue would both plan and apply changes for in-process replicas within the processOneChange function. This was problematic for simulation as it was not possible to call processOneChange directly to apply the simulated result, without blocking the goroutine. This patch separates processOneChange into planning (PlanOneChange), the application of the change (applyChange) and post application tracking (TrackChangeOutcome). resolves: #90533 Release note: None 91375: kv: recycle SpanSets returned during optimistic eval validation r=nvanbenschoten a=nvanbenschoten This commit adds `Release` calls for both SpanSets returned by `collectSpansRead` on the optimistic eval validation path. The failure to recycle these SpanSets was causing a leak from the `SpanSet` memory pool of both top level objects and the recycled inner slices. We have the same issue at the other caller of `collectSpansRead`, which is being tracked more broadly in #91374. Release note: None Epic: None Co-authored-by: Faizan Qazi <[email protected]> Co-authored-by: Austen McClernon <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
We accidentally introduced a regression in d6d4ccb due to the new call to
collectSpansRead
when recomputing a request's access span (post limiting).collectSpansRead
is allocation heavy and computationally expensive. In addition, we're also failing toRelease
the*spanset.SpanSet
objects that the function returns, so we're leaking from its memory pool (top level objects and recycled inner slices).An earlier revision of the PR included a new
getTrueSpans
function, which avoided the call tocollectSpansRead
. I think we'll want to do something like this. However, even ingetTrueSpans
, we were still constructing a*spanset.SpanSet
. We should explore whether we need to construct a*spanset.SpanSet
or whether we can get away with sometime simpler. Notice thatrecordBatchForLoadBasedSplitting
callsBoundarySpan
on this spanset, which reduces the full set to a single span. Can we compute the boundary span directly in O(1) memory (i.e. no heap allocations)? Can we push this into thespan
function passed toDecider.Record
so that we don't even pay this cost unless it is needed?NOTE: this was not included in the v22.2 release, so it's not a release blocker.
cc. @KaiSun314 @kvoli
Jira issue: CRDB-21237
The text was updated successfully, but these errors were encountered: