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

Description

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 a pg-restore CR be automatically created to give visibility that the DB had some data restored onto it.

Environment

None

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 AM
Edited

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.

Done

Details

Assignee

Reporter

Labels

Needs QA

Yes

Sprint

Fix versions

Priority

Smart Checklist

Created April 24, 2024 at 1:04 PM
Updated October 8, 2024 at 6:25 PM
Resolved September 23, 2024 at 1:43 PM