Page MenuHomePhabricator

[services] Backup - return log id of the newly created log to the client
ClosedPublic

Authored by karol on May 19 2022, 3:00 AM.
Tags
None
Referenced Files
F5903601: D4074.id.diff
Thu, Apr 17, 1:22 PM
F5901129: D4074.id13103.diff
Thu, Apr 17, 12:36 PM
F5887451: D4074.id13045.diff
Thu, Apr 17, 4:33 AM
F5886218: D4074.id12918.diff
Thu, Apr 17, 4:05 AM
Unknown Object (File)
Thu, Apr 17, 2:08 AM
Unknown Object (File)
Wed, Apr 16, 11:08 AM
Unknown Object (File)
Thu, Apr 10, 7:25 PM
Unknown Object (File)
Tue, Apr 8, 6:09 PM

Details

Summary

Depends on D4033

In order to Be able to send attachments for certain logs, we should first get new logs ids from the backup service.

Test Plan
  • terminal 1
cd services
yarn run-blob-service-dev-mode
  • terminal 2
cd services
yarn run-backup-service-dev-mode
  • terminal 3
git clone https://github.com/karol-bisztyga/grpc-playground.git
cd grpc-playground
git checkout backup-async
./build.sh
./cmake/build/bin/client

Then in terminal 3 create a new backup

n

Then in terminal 3 create a new log

l

And see that you obtained a new log id.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

karol edited the test plan for this revision. (Show Details)
karol added a reviewer: tomek.
tomek added a reviewer: ashoat.

Adding @ashoat as the proto is changed

services/backup/src/Reactors/server/CreateNewBackupReactor.cpp
94–95 ↗(On Diff #12918)

Shouldn't we update these in a diff that moved the tools?

ashoat added inline comments.
native/cpp/CommonCpp/grpc/protos/backup.proto
55 ↗(On Diff #12918)

Is the logID a timestamp? I wonder if it's better to be more specific here and call this logCheckpoint or logTimestamp or something

services/backup/src/Reactors/server/CreateNewBackupReactor.cpp
94–95 ↗(On Diff #12918)

Agree, looks like something may have gone wrong with Git here?

This revision is now accepted and ready to land.May 23 2022, 10:50 AM
native/cpp/CommonCpp/grpc/protos/backup.proto
55 ↗(On Diff #12918)

Log id != log timestamp.
Log ID generating function:

std::string SendLogReactor::generateLogID(const std::string &backupID) {
  return backupID + tools::ID_SEPARATOR +
      std::to_string(tools::getCurrentTimestamp());
}

I'm not going to do any updates here as you were wrong with your assumption. If you still think the naming can be better here, let me know. Nevertheless, I think the naming is at its best here. We have a function generateLogID and then we want to return it to the client. It is stored in the DB as the logID. Why adding such a confusion here?

ashoat added inline comments.
native/cpp/CommonCpp/grpc/protos/backup.proto
56 ↗(On Diff #13045)

Thanks for clarifying! I can see it's not a timestamp, but it is monotonically increasing, so it might count as a "checkpoint".

I guess in this case we can treat the SendLog as an independent operation, but if/when we do have multiple logs queued up, it might make sense to checkpoint their upload, just like we checkpoint their download.

native/cpp/CommonCpp/grpc/protos/backup.proto
56 ↗(On Diff #13045)

Ok, so from what I understand, despite the inconsistency in naming, you still think we should have logCheckpoint here.