Skip to content

Commit fb04386

Browse files
goffrieConvex, Inc.
authored and
Convex, Inc.
committed
Do not fail with out_of_retention when doing a noop refresh_token (#35713)
GitOrigin-RevId: 56fda26310980435072af9d6b4d3b2c3e137a806
1 parent 15d5c9f commit fb04386

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/database/src/write_log.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ pub struct LogReader {
371371
impl LogReader {
372372
#[fastrace::trace]
373373
pub fn refresh_token(&self, token: Token, ts: Timestamp) -> anyhow::Result<Option<Token>> {
374+
if token.ts() == ts {
375+
// Nothing to do. We can return Some even if `token.ts()` has fallen
376+
// out of the write log retention window.
377+
return Ok(Some(token));
378+
}
374379
let snapshot = { self.inner.lock().log.clone() };
375380
block_in_place(|| {
376381
let max_ts = snapshot.max_ts();

0 commit comments

Comments
 (0)