GSA-TTS / FAC

GSA's Federal Audit Clearinghouse
Other
18 stars 5 forks source link

FAC Backup Utility Enhancements #3944

Open asteel-gsa opened 3 weeks ago

asteel-gsa commented 3 weeks ago

Description: Once https://github.com/GSA-TTS/FAC/pull/3916 is successfully merged and validated, we want to enhance the utility to make sure it is even more robust than it currently is.

In order to: optimize the restore process as a: engineer I want: to not have to store the table.dump file on the file system, and instead do everything it needs with pipes.

Acceptance Criteria

Storing the s3 table dump is no longer required to be on the file system, and the tool directly performs the restoration without leaving files on the system.

Scenario:

Given: I am doing a restore from s3 when: the command runs I should be able to restore the table without leaving files on the system due to the table size. ...

### then...
- [ ] Modify the format of the db_to_s3 dump to be raw sql
- [ ] Refactor the psql pipe to support inpipe sql
- [ ] Investigate the stdout, and ensure the commands aren't output to avoid unncessary strain on the cpu
- [ ] Test and validate that table restoration occurs with the pipe, rather than files on disk (--data-only)

In order to: ensure that this tool can properly account for data restoration efforts as a: engineer I want: the tool to backup more information on the database, to ensure it can handle a partial or full table corruption

Acceptance Criteria

Working with the data team, we want to have a collection of items in the s3/rds that we can use to perform an entire table restoration if the table is missing or corrupted.

Scenario:

Given: a table is missing from the rds when: the utility goes to restore ...

### then...
- [x] the utility knows what tables should be there in the database
- [x] the utility checks to see if they exist but aren't
- [x] the utility should isolate any missing tables
- [ ] restore the specific table(s)

Consideration

asteel-gsa commented 3 weeks ago

While this is preliminary, @jadudm and I have discussed some key points from this.

The big item we have to investigate is: