Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
136780: stats: use no-op DatumAlloc when decoding EncDatums r=yuzefovich a=yuzefovich **tree: make nil DatumAlloc act as a no-op** This commit makes so that `nil` `DatumAlloc` value makes the alloc struct a no-op, i.e. each datum type passed by value results in a separate allocation. This can be useful when the callers will keep only a subset of all allocated datums. Release note: None **stats: use no-op DatumAlloc when decoding EncDatums** This commit fixes a bounded memory leak that could previously occur due to usage of the DatumAlloc when decoding EncDatums into `tree.Datum`s during table stats collection. We have two use cases for decoded `tree.Datum`s: - we need it when adding _all_ rows into the sketch (we compute the datum's fingerprint ("hash") to use in the distinct count estimation). This usage is very brief and we don't need the decoded datum afterwards. - we also need it when sampling _some_ rows when we decide to keep a particular row. In this case, the datum is needed throughout the whole stats collection job (or until it's replaced by another sample) for the histogram bucket computation. The main observation is that the DatumAlloc allocates datums in batches of 16 objects, and even if at least one of the objects is kept by the sample, then all others from the same batch are as well. We only perform memory accounting for the ones we explicitly keep, yet others would be considered live by the Go runtime, resulting in a bounded memory leak. This behavior has been present since forever, but it became more problematic in 24.2 release with the introduction of dynamically computing the sample size. To go around this problematic behavior this commit uses `nil` DatumAlloc which makes it so that every decoded datum incurs a separate allocation. This will have a minor performance hit and increase in total number of allocations, but at least most of them should be short-lived. Alternatively, we could use an "operating" DatumAlloc during fingerprinting and a no-op during the sampling, but we'd need to explicitly nil out the decoded datum after fingerprinting which would result in decoding some datums twice. Fixes: #136394. Release note: None 136901: kvserver: deflake TestStoreRangeMergeConcurrentRequests r=iskettaneh a=iskettaneh Fixes: #136774 Release note: None 136994: kvserver: deflake TestLeaseRequestFromExpirationToEpochOrLeaderDoesNotRegressExpiration r=iskettaneh a=iskettaneh This commit deflakes TestLeaseRequestFromExpirationToEpochOrLeaderDoesNotRegressExpiration by establishing the node liveness record before pausing node liveness heartbeats. Fixes: #136549 Release Note: None 137039: sql/tests: add `ANALYZE` to sysbench microbenchmark r=mgartner a=mgartner Collecting table statistics manually during the benchmark setup makes the performance more representative of a real-world workload without the variance in results that automatic stats collection would introduce. Epic: None Release note: None 137049: teamcity: remove `bench` scripts r=jlinder a=rickystewart These jobs are very flaky and extremely time-consuming at about an hour per run. Simply delete the scripts. Closes: #136470 Epic: none Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Ibrahim Kettaneh <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
- Loading branch information