Skip to content

Use transaction time for deletion time cache ticker#2848

Merged
gbrodman merged 1 commit into
google:masterfrom
gbrodman:cache
Oct 16, 2025
Merged

Use transaction time for deletion time cache ticker#2848
gbrodman merged 1 commit into
google:masterfrom
gbrodman:cache

Conversation

@gbrodman

@gbrodman gbrodman commented Oct 15, 2025

Copy link
Copy Markdown
Collaborator

Basically, what happened is that the cache's expireAfterWrite was being called some number of milliseconds (say, 50) after the transaction was started. That method used the transaction time instead of the current time, so as a result the entries were sticking around 50ms longer in the cache than they should have been.

This fix contains two parts, each of which I believe would be sufficient on their own to fix the issue:

  1. Use the currentTime passed in in Expiry::expireAfterCreate
  2. Use the transaction time in the cache's Ticker. This keeps everything on the same schedule.

This change is Reviewable

Basically, what happened is that the cache's expireAfterWrite was being
called some number of milliseconds (say, 50-100) after the transaction
was started. That method used the transaction time instead of the
current time, so as a result the entries were sticking around 50-100ms
longer in the cache than they should have been.

This fix contains two parts, each of which I believe would be sufficient
on their own to fix the issue:
1. Use the currentTime passed in in Expiry::expireAfterCreate
2. Use the transaction time in the cache's Ticker. This keeps everything
   on the same schedule.

@ptkach ptkach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ptkach reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gbrodman)

@gbrodman
gbrodman added this pull request to the merge queue Oct 16, 2025
Merged via the queue into google:master with commit b144aaf Oct 16, 2025
9 checks passed
@gbrodman
gbrodman deleted the cache branch October 16, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants