Page MenuHomePhabricator

[services] Backup - Database - add Backup Item
ClosedPublic

Authored by karol on Feb 3 2022, 6:51 AM.
Tags
None
Referenced Files
F3536850: D3087.id9800.diff
Wed, Dec 25, 7:09 PM
F3536849: D3087.id9654.diff
Wed, Dec 25, 7:09 PM
F3536848: D3087.id9440.diff
Wed, Dec 25, 7:09 PM
F3536847: D3087.id9437.diff
Wed, Dec 25, 7:09 PM
F3536845: D3087.id9367.diff
Wed, Dec 25, 7:09 PM
F3536844: D3087.id9217.diff
Wed, Dec 25, 7:09 PM
F3536842: D3087.id10058.diff
Wed, Dec 25, 7:09 PM
F3536841: D3087.diff
Wed, Dec 25, 7:09 PM

Details

Summary

C++ representation of the backup database entity

Depends on D3084

Test Plan

-

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

karol edited the summary of this revision. (Show Details)
karol edited the test plan for this revision. (Show Details)
karol added reviewers: tomek, max, varun.
tomek added inline comments.
services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
19 ↗(On Diff #9367)

Interesting... shouldn't #include <vector> be necessary?

24 ↗(On Diff #9367)

Can this be const?

This revision is now accepted and ready to land.Feb 8 2022, 8:43 AM
This revision now requires review to proceed.Feb 8 2022, 8:43 AM
ashoat added a reviewer: jim.
ashoat added inline comments.
services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
19 ↗(On Diff #9367)

Please add this. Often C++ seems to let this sort of thing go, but I wish it didn't

This revision is now accepted and ready to land.Feb 8 2022, 8:41 PM
karol edited the summary of this revision. (Show Details)

include vector

karol added inline comments.
services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
18 ↗(On Diff #9437)

this should be merged with the recoveryData

19 ↗(On Diff #9367)

right, thanks

24 ↗(On Diff #9367)

This can be const but I think we should refactor all services
https://linear.app/comm/issue/ENG-707/convert-table-names-to-const

encryptedBackupKey merged into recoveryData

This revision is now accepted and ready to land.Feb 9 2022, 4:21 AM
ashoat added inline comments.
services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp
57–59 ↗(On Diff #9367)

Did you purposely remove the compactionHolder validation here? Not sure why

This revision is now accepted and ready to land.Feb 15 2022, 7:36 PM
services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp
57–59 ↗(On Diff #9367)

Yes. This is because I added the index for created as we discussed in https://phabricator.ashoat.com/D3160. In this index, we will have the following fields projected:

userID
backupID
created
recoveryData

There's no point in projecting compaction data for RecoverBackupKey.
Therefore we'll encounter a situation when the compaction data will not be provided and it will not be an error.

Makes sense. Would be good to add a code comment clarifying this, see inline

services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
12 ↗(On Diff #9654)

Might be good to add a code comment here clarifying that this class is used for representing two things: the rows in the main table, and also the rows in the secondary index

services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
32 ↗(On Diff #10058)

The requested code comment was not added here!! This is very concerning to see... I want to be able to accept diffs with comments, but actions like this where you ignore my comments make it really hard for me to do that.

@karol-bisztyga: in the future, would you prefer that I request changes any time I have any small comments?

Hey, sorry about this. I think we can keep the current pattern of accepting + comments, I address everything most of the time, not sure why I missed these.

services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
12 ↗(On Diff #9654)