Hi team!
At Yandex.Cloud we are working on efficient and reliable backups for Greenplum with WAL-G.
WAL-G uses physical backup and WAL to restore a cluster to some consistent recovery point. Recovery points can be created on demand by calling WAL-G or GP function directly. Basebackups and cluster history are stored in S3 in a compressed and encrypted format.
The most notable advantages of this approach are:
- extremely efficient: eg few hundreds of terrabytes are restored within some hours
- restore on point in time (you can have many points, e.g. every hour or every 10 minutes, but not exactly the same PITR as Postgres has)
- backup does not block DDL
Delta backups for Greenplum
Greenplum heap tables can be backuped exactly as PostgreSQL tables. But the AO\AOCS tables are of special interest. AFAIK AO segments are immutable, if they are present in one backup it would make sense to just store a link on their S3 image. This opens interesting perspectives.
When detla\full backup is done we could store only new AO segments. This is a very low-hanging fruit that could save a lot of network bandwidth.
When the segment runs low on disk quota we could just kill some segments locally and make a note: when the segment will be requested - read it from S3.
For this, we could provide some archive_command-like mechanics. For example, we could name it segment_archive_command\segment_restore_command. We could start from manually archiving segments, then move to automatic eviction of unnecessary data to S3.
Finally, I'd be happy if we could do cluster resharding through S3: when you create a new shard just mark all segments as "evicted" and the segment is ready to run.
And sorry for posting twice. My first message from corp mail was not
delivered, so I used my personal email. And then it was delivered :)
So, I'll continue from the personal box.
We will start with the simplest part: backup AO files only once,
maintain reference count, reuse the file whenever possible. To start a
project we need to solve one small technical problem. When WAL-G sees
a file on FS we need to identify if the file is AO segment or not. And
if it's AO WAL-G needs to generate some unique key for the file. But
the latter seems trivial - we can just take a file path+name.
What is the most efficient way to tell AO segment from regular heap
segment? Can we do this without interacting with DB?
Gradually moving on to (snow)flacky things.
On Friday, April 15, 2022 at 9:02:18 AM UTC+5 ambor...@gmail.com wrote:Gradually moving on to (snow)flacky things.
Few weeks ago we have released WAL-G 2.0 with a support for Greenplum online backups [0]. Current implementation employs shared storage of AOCS segments, which in effect is almost as effective as Postgres incremental backups. But we will push it further gradually to real delta backup of AOCS segments based on logical EOF.Meanwhile we are starting to work on automatic offload of AOCS segments to S3. And most appropriate place to detect that file is missing from FS seems to be Postrges smgr subsystem. Luckily, similar work is done in Postgres by engineers from Neon. So we propose to restore smgr and reuse pluggable smgr.What do you think?
According to our estimates we hope to have a production-ready version in 2023.