@@ -26,7 +26,8 @@ use mz_sql_parser::ast::{StatementKind, statement_kind_label_value};
2626use mz_storage_client:: controller:: IntrospectionType ;
2727use qcell:: QCell ;
2828use rand:: SeedableRng ;
29- use rand:: { distributions:: Bernoulli , prelude:: Distribution , thread_rng} ;
29+ use rand:: distr:: { Bernoulli , Distribution } ;
30+ use rand:: rngs:: SmallRng ;
3031use sha2:: { Digest , Sha256 } ;
3132use tokio:: time:: MissedTickBehavior ;
3233use tracing:: debug;
@@ -138,9 +139,9 @@ pub(crate) struct StatementLogging {
138139 unlogged_sessions : BTreeMap < Uuid , SessionHistoryEvent > ,
139140
140141 /// A reproducible RNG for deciding whether to sample statement executions.
141- /// Only used by tests; otherwise, `rand::thread_rng ()` is used.
142+ /// Only used by tests; otherwise, `rand::rng ()` is used.
142143 /// Controlled by the system var `statement_logging_use_reproducible_rng`.
143- reproducible_rng : rand_chacha :: ChaCha8Rng ,
144+ reproducible_rng : SmallRng ,
144145
145146 pending_statement_execution_events : Vec < ( Row , Diff ) > ,
146147 pending_prepared_statement_events : Vec < PreparedStatementEvent > ,
@@ -165,7 +166,7 @@ impl StatementLogging {
165166 Self {
166167 executions_begun : BTreeMap :: new ( ) ,
167168 unlogged_sessions : BTreeMap :: new ( ) ,
168- reproducible_rng : rand_chacha :: ChaCha8Rng :: seed_from_u64 ( 42 ) ,
169+ reproducible_rng : SmallRng :: seed_from_u64 ( 42 ) ,
169170 pending_statement_execution_events : Vec :: new ( ) ,
170171 pending_prepared_statement_events : Vec :: new ( ) ,
171172 pending_session_events : Vec :: new ( ) ,
@@ -697,7 +698,7 @@ impl Coordinator {
697698 {
698699 distribution. sample ( & mut self . statement_logging . reproducible_rng )
699700 } else {
700- distribution. sample ( & mut thread_rng ( ) )
701+ distribution. sample ( & mut rand :: rng ( ) )
701702 } ;
702703
703704 // Track how many statements we're recording.
0 commit comments