Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate redis streams #1278

Merged
merged 24 commits into from May 22, 2024
Merged

Truncate redis streams #1278

merged 24 commits into from May 22, 2024

Conversation

ddimaria
Copy link
Collaborator

@ddimaria ddimaria commented Apr 10, 2024

Closes #1270

  • Query Redis for all active channels
  • For each active channel, query the API service for the latest checkpoint (or one prior?)
  • Truncate the stream (channel) up to the set sequence number of the checkpoint
  • Add truncate info to stats (appears on logs)
  • Force client to reload the file if the transaction isn't available

Deployment Plan

  • Set new environment variables (1 week?)
TRUNCATE_FILE_CHECK_S=3600 # 1 hour
TRUNCATE_TRANSACTION_AGE_DAYS=5 # 5 days
  • Create a jump box that can connect to Redis with Redis CLI
  • Merge branch (wait until deploy)
  • Backup Redis
  • Shutdown multiplayer EC2
  • Wait until File service processes everything via DataDog logs
  • Clear existing redis cache (FLUSHDB)
  • Restartup multiplayer EC2
  • Verify files are being cleaned up

@cla-bot cla-bot bot added the cla-signed label Apr 10, 2024
Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quadratic ✅ Ready (Inspect) Visit Preview May 22, 2024 10:21pm

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1278 April 10, 2024 23:29 Inactive
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.17%. Comparing base (1e21d3a) to head (b4dfd94).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1278      +/-   ##
==========================================
+ Coverage   89.34%   90.17%   +0.82%     
==========================================
  Files         160      134      -26     
  Lines       26425    24393    -2032     
==========================================
- Hits        23610    21996    -1614     
+ Misses       2815     2397     -418     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddimaria ddimaria temporarily deployed to quadratic-api-dev-pr-1278 April 19, 2024 20:38 Inactive
@ddimaria ddimaria temporarily deployed to quadratic-api-dev-pr-1278 April 19, 2024 20:44 Inactive
@ddimaria ddimaria marked this pull request as ready for review April 19, 2024 20:55
@ddimaria ddimaria temporarily deployed to quadratic-api-dev-pr-1278 April 22, 2024 15:50 Inactive
@davidkircos davidkircos reopened this May 21, 2024
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1278 May 21, 2024 20:47 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1278 May 21, 2024 21:47 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1278 May 21, 2024 21:59 Inactive
@davidkircos davidkircos reopened this May 21, 2024
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1278 May 21, 2024 22:15 Inactive
@ddimaria ddimaria temporarily deployed to quadratic-api-dev-pr-1278 May 22, 2024 22:09 Inactive
@davidkircos davidkircos merged commit 3259c42 into main May 22, 2024
12 of 13 checks passed
@davidkircos davidkircos deleted the truncate-redis-streams branch May 22, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncate Redis Streams
2 participants