@@ -296,37 +296,22 @@ macro_rules! upsert_source_time_unit {
296296}
297297upsert_source_time_unit ! ( GtidPartition , Lsn ) ;
298298
299- /// Pager for the upsert-v2 source stash .
299+ /// Storage's leg of the process-wide chunk spill gate .
300300///
301- /// This draws from the same process-wide [`TieredPolicy`] budget pool as the
302- /// compute column-paged batcher — there is one budget and one underlying
303- /// `mz_ore::pager` — but whether the stash *uses* it is gated by storage's own
304- /// `enable_upsert_paged_spill` flag, independently of compute's
305- /// `enable_column_paged_batcher_spill`. The shared pool's budget / backend /
306- /// codec are configured by compute's `apply_tiered_config` (storage and compute
307- /// run in the same `clusterd` process).
301+ /// The upsert-v2 source stash and feedback arrangement spill through the
302+ /// process buffer pool ([`mz_timely_util::columnar::chunk`]): committed chunk
303+ /// bodies land in the pool once compute's config handler has installed and
304+ /// budgeted it (storage and compute run in the same `clusterd` process).
308305///
309- /// [`TieredPolicy`]: mz_timely_util::column_pager::policy::TieredPolicy
310- pub mod upsert_stash_pager {
311- use std:: sync:: { LazyLock , RwLock } ;
312-
313- use mz_timely_util:: column_pager:: { ColumnPager , shared_pager} ;
314-
315- /// Active pager handed to upsert source-stash batchers. Defaults to
316- /// disabled (every chunk resident) until [`set_enabled`] turns it on.
317- static PAGER : LazyLock < RwLock < ColumnPager > > =
318- LazyLock :: new ( || RwLock :: new ( ColumnPager :: disabled ( ) ) ) ;
319-
320- /// Enable or disable the stash's use of the shared column pager. When
321- /// enabled, the stash spills through the shared budget pool; when disabled
322- /// it keeps every chunk resident.
306+ /// The gate is process-wide with one leg per subsystem, and chunks spill
307+ /// while either leg is set. Storage sets its leg from
308+ /// `enable_upsert_paged_spill`, so that flag alone cannot veto spilling
309+ /// enabled by compute's leg. The gate is consulted at every chunk commit, so
310+ /// flips apply to running dataflows.
311+ pub mod upsert_stash_spill {
312+ /// Enable or disable spilling of upsert chunk bodies to the buffer pool.
323313 pub fn set_enabled ( enabled : bool ) {
324- * PAGER . write ( ) . expect ( "upsert stash pager poisoned" ) = shared_pager ( enabled) ;
325- }
326-
327- /// The current upsert-stash pager. Cheap: clones the inner `Arc`.
328- pub fn pager ( ) -> ColumnPager {
329- PAGER . read ( ) . expect ( "upsert stash pager poisoned" ) . clone ( )
314+ mz_timely_util:: columnar:: chunk:: set_storage_spill_enabled ( enabled) ;
330315 }
331316}
332317
0 commit comments