Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

wal-g: Support alternate S3 storage classes.

Alex Vandiver5a26237b543f
diff --git a/docs/production/deployment.md b/docs/production/deployment.md
index e4bd88d285f..f72120dab87 100644
--- a/docs/production/deployment.md
+++ b/docs/production/deployment.md
@@ -908,6 +908,19 @@ may wish to increase this if you are taking backups on a replica, so can afford
to affect other disk I/O, and have an SSD which is good at parallel random
reads.
+#### `backups_storage_class`
+
+What [storage class](https://aws.amazon.com/s3/storage-classes/) to use when
+uploading database backups. Defaults to `STANDARD`, meaning "[S3
+standard][s3-standard]", but many deployments will have overall lower costs if
+"[S3 Standard - Infrequent Access][s3-ia]" is used, via the `STANDARD_IA`
+value. Also supported is "[S3 Reduced Redundancy][s3-rr]", by setting
+`REDUCED_REDUNDANCY`, but this is not suggested for production use.
+
+[s3-standard]: https://aws.amazon.com/s3/storage-classes/#General_purpose
+[s3-ia]: https://aws.amazon.com/s3/storage-classes/#Infrequent_access
+[s3-rr]: https://aws.amazon.com/s3/reduced-redundancy/
+
#### `missing_dictionaries`
If set to a true value during initial database creation, uses PostgreSQL's
diff --git a/puppet/zulip/files/postgresql/env-wal-g b/puppet/zulip/files/postgresql/env-wal-g
index 7667c8d6dcc..9be7bd1d51f 100755
--- a/puppet/zulip/files/postgresql/env-wal-g
+++ b/puppet/zulip/files/postgresql/env-wal-g
@@ -22,4 +22,9 @@ if ! s3_backups_bucket=$(crudini --get "$ZULIP_SECRETS_CONF" secrets s3_backups_
exit 1
fi
export WALG_S3_PREFIX="s3://$s3_backups_bucket"
+
+if storage_class=$(crudini --get /etc/zulip/zulip.conf postgresql backups_storage_class 2>&1); then
+ export WALG_S3_STORAGE_CLASS="$storage_class"
+fi
+
exec /usr/local/bin/wal-g "$@"