Page MenuHomePhabricator

D3634.id11108.diff
No OneTemporary

D3634.id11108.diff

diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
--- a/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/PullBackupReactor.h
@@ -88,7 +88,28 @@
std::unique_ptr<grpc::Status>
PullBackupReactor::writeResponse(backup::PullBackupResponse *response) {
- throw std::runtime_error("unimplemented");
+ // we make sure that the blob client's state is flushed to the main memory
+ // as there may be multiple threads from the pool taking over here
+ const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
+ switch (this->state) {
+ case State::COMPACTION: {
+ this->initializeGetReactor(this->backupItem->getCompactionHolder());
+ std::string dataChunk;
+ this->dataChunks->blockingRead(dataChunk);
+ if (dataChunk.empty()) {
+ // TODO try to immediately start writing logs instead of wasting a cycle
+ // sending nothing
+ this->state = State::LOGS;
+ return nullptr;
+ }
+ response->set_compactionchunk(dataChunk);
+ return nullptr;
+ }
+ case State::LOGS: {
+ throw std::runtime_error("unimplemented");
+ }
+ }
+ throw std::runtime_error("unhandled state");
}
} // namespace reactor

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 10, 1:36 AM (10 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2842826
Default Alt Text
D3634.id11108.diff (1 KB)

Event Timeline