Renew config message TTLs at most once an hour per swarm - #796
Merged
mpretty-cyro merged 2 commits intoSep 28, 2026
Merged
mpretty-cyro merged 2 commits into
mpretty-cyro merged 2 commits into
Conversation
Every poll asked the swarm to extend the TTL of every active config message, which is a write on each storage node holding them, every few seconds, from every client. Service nodes see real disk I/O from it. The extension is now skipped for a swarm whose last extension succeeded within the hour. The user swarm and each group swarm are tracked separately. A failed extension leaves the cooldown untouched so the next poll retries it. State is in memory only, so the first poll after launch always extends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every poll asked the swarm to extend the TTL of every active config message. That is a write on every storage node holding those messages, every few seconds, from every client, and service nodes see real disk I/O from it. The extension goes to weeks from now, so doing it once an hour loses nothing.
The change
A poll now skips the config TTL extension for a swarm whose last extension succeeded within the last hour.
Disappearing-message expiry uses a separate path and is unchanged.
iOS specifics
Network.StorageServer.ConfigTtlExtensionThrottle(actor,.configTtlExtensionThrottlesingleton) holds the per-swarm timestamps.StorageServer.polldecides whether to include the expire sub-request, and records success only when that sub-response parsed and returned 2xx.dependencies.dateNow. A clock moved backwards counts as due, so a clock change can never hold the cooldown open.Verification
Seven new specs in
SwarmPollerSpec("a swarm poll refreshing config TTLs") drive the realStorageServer.pollagainstMockNetwork. They count the batch bodies that actually carry anexpiresub-request, so they check what is sent, not what the caller passed. Covered: two polls inside the window send one; a poll after the window sends another; a 500, an unparseable body, or a failed batch don't start the cooldown; a backwards clock; per-swarm independence.SwarmPollerSpec11/11 via theSessionscheme (-parallel-testing-enabled NO). With the 2xx check removed, the "extension fails" spec goes red.Same change in the other clients