feat: support using zstd for snapshots, fix postgres:9 snapshot, fixes #7844, fixes #3583#7845
feat: support using zstd for snapshots, fix postgres:9 snapshot, fixes #7844, fixes #3583#7845
postgres:9 snapshot, fixes #7844, fixes #3583#7845Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
|
I will push new Docker images. |
|
It looks like it's not installed by default everywhere: https://github.com/ddev/ddev/actions/runs/19301022329/job/55195278110?pr=7845#step:13:4585 |
|
The build is successful for everything, except https://github.com/stasadev/ddev/actions/runs/19308126195/job/55220901864 It was added in Ubuntu 18.04 https://balintreczey.hu/blog/hello-zstd-compressed-debs-in-ubuntu/ |
|
If it's difficult to get zstd onto mariadb:5.5, it's OK to disable snapshots for that or to insist on gzipped snapshots. |
|
I disabled snapshots for
We can come back to this later. |
|
Doesn't work for mysql:5.5 https://github.com/ddev/ddev/actions/runs/19309228694/job/55224771825#step:13:7284
|
|
I thought they would be from the same era. Neither needs to support snapshots. |
|
|
Is this going to work for |
|
It does if you wrap it in single quotes. Pushed a change doing that! |
|
It looks like we have some upstream network issues. |
|
Getting pretty familiar with these! https://www.githubstatus.com/ |
8b79323 to
134c275
Compare
|
In https://github.com/ddev/ddev/actions/runs/19575538227/job/56059696814?pr=7845:
It's not clear to me how this is related to the changes in this PR. Any pointers? |
It looks like it's a change upstream, not related to this PR, I'll take a look. |
tyler36
left a comment
There was a problem hiding this comment.
Tested with Postgres:12 and Postgres:16 and it worked well.
I was using small database but it was consistently a few seconds faster then 1.24.10 snapshots.
- ✅ Backup database
- ✅ Restore
zstdatabase - ✅ Restore
gzdatabase
I appreciate the following line:
This snapshot was created with gzip. It's recommended to create a new snapshot using zstd for better performance.
It makes me wonder, "How do I change to zstd?".
Happy to "approve" once the upstream issue (?) is resolved.
de23c75 to
96b70ba
Compare
|
Rebased, dropped merge commit, resolved conflicts, pushed images: |
|
https://github.com/ddev/ddev/actions/runs/19666937210/job/56326105327?pr=7845#step:13:7328 |
|
@tyler36 re:
Any new snapshots will be automatically created using zstd. Do you have suggestions on making the text clearer? Of course, users can manually recompress the snapshots, but I don't think it's worth it to explain that - and it's a way users could mess things up too! |
|
I've added version checks for zstd, let's see if that fixes things. |
After thinking about it for a bit, the only suggestion I could come up with was the follow. It still feels too wordy though. |
|
I don't think this needs to be mentioned. gzip will be old very soon. |
2fb1c4f to
f7938ee
Compare
a3d909c to
8db70f4
Compare
There was a problem hiding this comment.
(Rebased)
Thanks for the great contribution! My experience with my old hugedb (289MB sql.gz, snapshot 929M gzipped, 799M zst):
6:30 to import from sql.gz
0:26 to snapshot with zstd, 3:44 to snapshot with gzip (HEAD)
1:30 to snapshot restore with zstd, 1:55 to restore with gzip
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
e1abb7f to
282c0b4
Compare
There was a problem hiding this comment.
Looks good to me, thank you!
MySQL 8.0, 283 MB sql (51 MB sql.gz)
v1.24.10: snapshot 38s, restore 47s
this PR: snapshot 9s, restore 43s
I added back support for mariadb:5.5 gz snapshots, and fixed postgres:9.
It makes me wonder, "How do I change to zstd?".
Any new snapshots will be automatically created using zstd. Do you have suggestions on making the text clearer?
I rephrased this warning to:
-This snapshot was created with gzip. It's recommended to create a new snapshot using zstd for better performance.
+This snapshot uses gzip compression. Creating a new snapshot will automatically use faster zstd compression.postgres:9 snapshot, fixes #7844, fixes #3583
The Issue
ddev snapshot restoredoesn't work with postgres:9 #3583Implements zstd compression for database snapshots.
Adds snapshot support for
postgres:9For a 19GB mariadb database, this change:
How This PR Solves The Issue
We still support importing gzip databases, but warn the user to re-export. They could manually convert the backup too, but I think it's better to encourage the user to to follow our tools so we can control the export process.
Manual Testing Instructions
Automated Testing Overview
Release/Deployment Notes
None.