Skip to content

Commit

Permalink
Update MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY from 10 to 100 minut…
Browse files Browse the repository at this point in the history
…es (#30353)

GitOrigin-RevId: 99fdd292a57b4bc0e581d4a2a3cc1901734ab27d
  • Loading branch information
emmaling27 authored and Convex, Inc. committed Oct 4, 2024
1 parent f955c25 commit b940cc1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions crates/common/src/knobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,14 @@ pub static TRANSACTION_MAX_READ_SIZE_BYTES: LazyLock<usize> = LazyLock::new(|| {
pub static TRANSACTION_MAX_READ_SET_INTERVALS: LazyLock<usize> =
LazyLock::new(|| env_config("TRANSACTION_MAX_READ_SET_INTERVALS", 4096));

/// Write max_repeatable_ts if there have been no commits for this duration,
/// to allow reads to stay fresh.
/// Write max_repeatable_ts if there have been no commits for this duration.
/// Audit calls to `new_static_repeatable_ts` when changing this knob to make
/// sure it is safe to wait this amount of time before the max repeatable ts is
/// bumped.
pub static MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY: LazyLock<Duration> = LazyLock::new(|| {
Duration::from_secs(env_config(
"MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY",
10 * 60,
100 * 60,
))
});

Expand Down
10 changes: 5 additions & 5 deletions crates/common/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,11 @@ pub async fn new_static_repeatable_recent(

/// Waits for ts to be repeatable according to max_repeatable_ts.
/// Keep in mind max_repeatable_ts can lag behind the current time by
/// ~seconds to ~minutes. And if the committer is not running, the wait
/// may never complete and this function will error after 5m.
/// If you want a potentially stale timestamp and don't want to wait, use
/// new_recent. If you want a more up-to-date timestamp without waiting
/// as long, see if you can prove repeatability some other way.
/// ~seconds to ~minutes (see `MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY`). And if
/// the committer is not running, the wait may never complete and this function
/// will error after 5m. If you want a potentially stale timestamp and don't
/// want to wait, use new_recent. If you want a more up-to-date timestamp
/// without waiting as long, see if you can prove repeatability some other way.
pub async fn new_static_repeatable_ts<RT: Runtime>(
ts: Timestamp,
reader: &dyn PersistenceReader,
Expand Down

0 comments on commit b940cc1

Please sign in to comment.