HomePhabricator
Diffusion Comm 77c90e8592f4

[keyserver] Add maxDirSizeMiB to BackupConfig

Description

[keyserver] Add maxDirSizeMiB to BackupConfig

Summary:
This config allows a user to specify a maximum space usage of the backup directory. This should resolve ENG-1234.

We will always keep at least one backup, ignoring maxDirSizeMiB if the single most recent backup exceeds it. Otherwise we will delete old backups until the usage falls below the max.

Depends on D4282

Test Plan:

  1. I tested setting maxDirSizeMiB to fit 2.5 backups, then changed cron.js so it ran a backup soon. I confirmed after running that there were two backups, that they were the two most recent, and that one of them was new.
  2. Then I tested setting it to some low number, smaller than one backup. Made sure after running that there was precisely one brand new backup.

Reviewers: atul, yayabosh

Reviewed By: atul

Subscribers: palys-swm, Adrian

Differential Revision: https://phab.comm.dev/D4283

Details

Provenance
ashoatAuthored on Jun 15 2022, 5:03 PM
Reviewer
atul
Differential Revision
D4283: [keyserver] Add maxDirSizeMiB to BackupConfig
Parents
rCOMMcc2960919b8c: [keyserver] Extract deleteBackup
Branches
Unknown
Tags
Unknown