@@ -524,7 +524,7 @@ pub static SEARCH_INDEX_WORKER_PAGES_PER_SECOND: LazyLock<NonZeroU32> = LazyLock
524524 )
525525} ) ;
526526
527- /// Don't allow database workers to have more than an hour of uncheckpointed
527+ /// Don't allow search index workers to have more than an hour of uncheckpointed
528528/// data.
529529///
530530/// For search/vector index workers - Note that fast-forwarding will keep the
@@ -535,8 +535,8 @@ pub static SEARCH_INDEX_WORKER_PAGES_PER_SECOND: LazyLock<NonZeroU32> = LazyLock
535535/// DocumentRevisionStream to build new segments, so this value needs to be low
536536/// enough to not block the search index flushers for too long, or else writes
537537/// will start failing. This is why we set this value lower for pro users (10m).
538- pub static DATABASE_WORKERS_MAX_CHECKPOINT_AGE : LazyLock < Duration > =
539- LazyLock :: new ( || Duration :: from_secs ( env_config ( "DATABASE_WORKERS_MAX_CHECKPOINT_AGE " , 3600 ) ) ) ;
538+ pub static SEARCH_WORKERS_MAX_CHECKPOINT_AGE : LazyLock < Duration > =
539+ LazyLock :: new ( || Duration :: from_secs ( env_config ( "SEARCH_WORKERS_MAX_CHECKPOINT_AGE " , 3600 ) ) ) ;
540540
541541/// Don't fast-forward an index less than ten seconds forward so we don't
542542/// amplify every commit into another write when the system is under heavy load.
@@ -1237,19 +1237,24 @@ pub static MAX_SEARCHLIGHT_REQUEST_SIZE: LazyLock<usize> =
12371237/// other than the other workers happens.
12381238///
12391239/// We must also ensure that workers advance periodically to ensure that we can
1240- /// run document retention in the future . Database times are bumped periodically
1240+ /// run document retention. Database times are bumped periodically
12411241/// even if no writes occur. So any worker that checks this should always have
12421242/// some maximum period of time after which they checkpoint unconditionally.
12431243pub static DATABASE_WORKERS_MIN_COMMITS : LazyLock < usize > =
12441244 LazyLock :: new ( || env_config ( "DATABASE_WORKERS_MIN_COMMITS" , 500 ) ) ;
12451245
1246+ /// Update table summaries for idle instances once every 4 hours.
1247+ pub static TABLE_SUMMARY_MAX_CHECKPOINT_AGE : LazyLock < Duration > = LazyLock :: new ( || {
1248+ Duration :: from_secs ( env_config ( "TABLE_SUMMARY_MAX_CHECKPOINT_AGE" , 4 * 60 * 60 ) )
1249+ } ) ;
1250+
12461251/// The TableSummaryWorker must checkpoint every
1247- /// [`DATABASE_WORKERS_MAX_CHECKPOINT_AGE `] seconds even if nothing has changed.
1252+ /// [`TABLE_SUMMARY_MAX_CHECKPOINT_AGE `] seconds even if nothing has changed.
12481253/// However, to prevent all instances from checkpointing at the same time, we'll
12491254/// add a jitter of up to ±TABLE_SUMMARY_AGE_JITTER_SECONDS.
12501255///
12511256/// Note: the configured value is capped at
1252- /// `DATABASE_WORKERS_MAX_CHECKPOINT_AGE /2`.
1257+ /// `TABLE_SUMMARY_MAX_CHECKPOINT_AGE /2`.
12531258pub static TABLE_SUMMARY_AGE_JITTER_SECONDS : LazyLock < f32 > =
12541259 LazyLock :: new ( || env_config ( "TABLE_SUMMARY_AGE_JITTER_SECONDS" , 900.0 ) ) ;
12551260
0 commit comments