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
139279: sqlstats: fix race condition in ss_mem_iterator r=kyle-a-wong a=kyle-a-wong StmtStatsIterator.Next() copies the next statement stats info into a new CollectedStatementStatistics object, but the slice fields of stmtStats.mu.data are not copied explicitly. This makes them susecptible to race conditions, as seen in cockroachdb#138224. To fix, all slice fields in the StatementStatistics are explicitly copied, using a new util.CopySlice function. Fixes: cockroachdb#138224 Epic: none Release note: none 140035: opt: reduce `opt.ColSet` allocs when exploring partial index scans r=mgartner a=mgartner When exploring a partial index scan, we previously built a set of columns held constant by partial index predicate, and then built another set of those columns that are not composite key encoded. Now, instead of building the second set, we remove columns from the first. This will reduce allocations in the case where the constant column IDs are larger than 128. Epic: None Release note: None Co-authored-by: Kyle Wong <[email protected]> Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information