-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
140409: metric: remove mutex around windowed histogram update r=dhartunian a=dhartunian Previously, we used an `RWMutex` to serialize access to the windowed histogram. This was done because there's a rotation that needs to happen that moves the currently active histogram into the `prev` variable and creates a fresh one to update in `cur`. This is done to maintain the window. This change limits the mutex usage to rotation and window snapshotting, removing the need to take a read lock during updates since we can atomically grab the `cur` histogram. There's a bit of nuance to manage around the fact that `prev` can be nil on the first iteration, since `cur` is the first histogram. After a single rotation, `prev` will not be nil again. The prometheus histogram itself (what's stored in the `atomic.Value`) is thread-safe. ``` old: dhartunian@507c68f Merge #140092 new: dhartunian@ff9dd52 metric: remove mutex around windowed histogram upd args: benchdiff "./pkg/util/metric" "-b" "-r" "BenchmarkHistogramRecordValue" "-c" "10" "--preview" name old time/op new time/op delta HistogramRecordValue/insert_zero-10 30.7ns ± 8% 24.3ns ± 2% -20.94% (p=0.000 n=9+8) HistogramRecordValue/insert_integers-10 37.4ns ± 6% 33.8ns ± 1% -9.83% (p=0.000 n=8+8) HistogramRecordValue/random_integers-10 44.9ns ± 9% 41.7ns ± 1% -7.25% (p=0.000 n=8+8) name old alloc/op new alloc/op delta HistogramRecordValue/insert_integers-10 0.00B 0.00B ~ (all equal) HistogramRecordValue/insert_zero-10 0.00B 0.00B ~ (all equal) HistogramRecordValue/random_integers-10 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta HistogramRecordValue/insert_integers-10 0.00 0.00 ~ (all equal) HistogramRecordValue/insert_zero-10 0.00 0.00 ~ (all equal) HistogramRecordValue/random_integers-10 0.00 0.00 ~ (all equal) ``` Part of #133306 Release note: None 140676: backup: disable autocommit_before_ddl for backup tests r=rafiss a=rafiss The autocommit behavior causes some flakiness in the remote CI environment. When the cluster is overloaded, transactions that perform schema changes are more likely to be aborted since they don't heartbeat frequently enough. This means they get aborted when they are pushed by background transactions such as the spanconfig reconciler and the job registry "reclaim jobs" task. Also, keeping schema changes in transactions makes some test setup faster. fixes #140354 fixes #140346 fixes #140334 fixes #140333 fixes #140550 Release note: None Co-authored-by: David Hartunian <[email protected]> Co-authored-by: Rafi Shamim <[email protected]>
- Loading branch information
Showing
60 changed files
with
34 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,3 @@ CREATE DATABASE r1; | |
exec-sql | ||
RESTORE cfs FROM LATEST IN 'nodelocal://1/foo' WITH into_db='r1'; | ||
---- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.