Skip to content

Commit fa9fc3e

Browse files
committed
WPB-28377: address review nits (changelog wording, DB-side cleanup cutoff)
1 parent 423f1b6 commit fa9fc3e

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

changelog.d/0-release-notes/WPB-28377-remove-redis

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Operators must:
1111
- Add the new required configuration `gundeck.config.postgresql` (plus
1212
`postgresqlPool`, and optionally `secrets.pgPassword` for the password file),
1313
following the same format as brig's postgresql settings.
14-
- Presence data does not carry over: the presence cache starts empty on
15-
upgrade and refills as clients reconnect.
16-
- The `redis-ephemeral` and `reaper` helm charts have been removed.
14+
- Restart all cannons after deployment is successful. Presence data does
15+
not carry over, this will make sure all clients reconnect after the
16+
presence data is being written to PostgreSQL.
17+
- Stop deploying `redis-ephemeral` and `reaper`, these have been removed.

services/gundeck/src/Gundeck/Presence/Data.hs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ deleteAll pp =
100100
-- presence rows; this only guards against leaks from abnormally dead pods
101101
-- (replaces the redis key TTL).
102102
cleanup :: Gundeck ()
103-
cleanup = do
104-
nowMs <- posixTime
105-
let cutoff = msToUtc (fromIntegral (ms nowMs - 7 * 24 * 60 * 60 * 1000))
106-
runPool $ statement cutoff deleteStale
103+
cleanup = runPool $ statement () deleteStale
107104

108105
-- Helpers -------------------------------------------------------------------
109106

@@ -170,9 +167,9 @@ deleteMany =
170167
AND p.created_at <= d.created_at
171168
|]
172169

173-
deleteStale :: Statement UTCTime ()
170+
deleteStale :: Statement () ()
174171
deleteStale =
175172
[resultlessStatement|
176173
DELETE FROM presence
177-
WHERE created_at < ($1 :: timestamptz)
174+
WHERE created_at < now() - interval '7 days'
178175
|]

0 commit comments

Comments
 (0)