Add pg-restore CR for initial restoration using the dataSource field
Description
Environment
Activity

Julio Pasinatto September 23, 2024 at 1:43 PM
Verified. When creating a cluster with dataSource
a pg-restore bootstrap object is created.

inel.pandzic August 22, 2024 at 1:47 PM
Hey no worries and thx for the info.
I was also thinking about this a bit more, and this situation maybe similar to how an initial backup is created with a brand-new PG cluster. In that case, we also create a pg-backup object and it is not a “classical” backup done by the user.
In a similar fashion I think it could be OK that we create a pg-restore object for a new DB created from dataSource
. And at the end of the day, it essentially is a restore so a pg-restore object that identifies it I think is a good thing.
Plus, it will give you guys a way to track it as well.
wdyt?

Diogo Recharte August 22, 2024 at 1:26 PM
I’m so sorry , I was in the middle of something else and got confused with the scope of this ticket, please disregard my previous comment.
The reason we would like to have the restore object is for consistency with PXC and PSMDB. In those operators we don’t have a data source field so when we want to create a new DB from a backup we first need to create the DB and then we apply the restore CR. This means that users see in the Everest UI that a restoration has happened which is good thing that shows that some data was restored. In PG, since we use the datasource field, users don’t get any feedback/history that some data has been restored from the everest UI standpoint it looks like they just provisioned a fresh/empty database. Having the restore object created automatically will give users a way of tracking the history of restorations in their DB.

inel.pandzic August 22, 2024 at 11:47 AMEdited
Sorry, what do you mean by This is a backup that takes up space in their storage
?
They know about that backup, it was made with a source cluster.

Diogo Recharte August 22, 2024 at 11:37 AM
Hi the reason is users' awareness. This is a backup that takes up space in their storage, hiding it from them doesn’t sound good.
By specifying the
dataSource
field in the PG spec the DB get initialized with the data from the backup. Given that this represents a restoration scenario, it makes sense to have apg-restore
CR be automatically created to give visibility that the DB had some data restored onto it.