Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3158453
D5038.id16739.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D5038.id16739.diff
View Options
diff --git a/services/backup/src/Reactors/server/PullBackupReactor.h b/services/backup/src/Reactors/server/PullBackupReactor.h
--- a/services/backup/src/Reactors/server/PullBackupReactor.h
+++ b/services/backup/src/Reactors/server/PullBackupReactor.h
@@ -41,6 +41,7 @@
std::string previousLogID;
bool endOfQueue = false;
bool clientInitialized = false;
+ std::unique_ptr<std::string> currentLogHolder;
const size_t chunkLimit =
GRPC_CHUNK_SIZE_LIMIT - GRPC_METADATA_SIZE_PER_MESSAGE;
diff --git a/services/backup/src/Reactors/server/PullBackupReactor.cpp b/services/backup/src/Reactors/server/PullBackupReactor.cpp
--- a/services/backup/src/Reactors/server/PullBackupReactor.cpp
+++ b/services/backup/src/Reactors/server/PullBackupReactor.cpp
@@ -66,7 +66,8 @@
}
std::string dataChunk;
if (this->internalBuffer.size() < this->chunkLimit) {
- rust::Vec<unsigned char> responseVec = get_client_blocking_read_cxx();
+ rust::Vec<unsigned char> responseVec = get_client_blocking_read_cxx(
+ this->backupItem->getCompactionHolder().c_str());
dataChunk = (responseVec.empty())
? ""
: std::string(reinterpret_cast<char *>(responseVec.data()));
@@ -121,6 +122,8 @@
// if the item is stored in the blob, we initialize the get reactor
// and proceed
this->initializeGetReactor(this->currentLog->getValue());
+ this->currentLogHolder =
+ std::make_unique<std::string>(this->currentLog->getValue());
} else {
// if the item is persisted in the database, we just take it, send the
// data to the client and reset currentLog so the next invocation of
@@ -140,7 +143,8 @@
// we get an empty chunk - a sign of "end of chunks"
std::string dataChunk;
if (this->internalBuffer.size() < this->chunkLimit && !this->endOfQueue) {
- rust::Vec<unsigned char> responseVec = get_client_blocking_read_cxx();
+ rust::Vec<unsigned char> responseVec =
+ get_client_blocking_read_cxx(this->currentLogHolder->c_str());
dataChunk = (responseVec.empty())
? ""
: std::string(reinterpret_cast<char *>(responseVec.data()));
@@ -167,6 +171,10 @@
this->previousLogID = this->currentLog->getLogID();
this->currentLog = nullptr;
this->endOfQueue = false;
+ if (this->currentLogHolder != nullptr) {
+ get_client_terminate_cxx(this->currentLogHolder->c_str());
+ this->currentLogHolder = nullptr;
+ }
}
std::string PullBackupReactor::prepareDataChunkWithPadding(
@@ -196,7 +204,7 @@
void PullBackupReactor::terminateCallback() {
const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
- get_client_terminate_cxx();
+ get_client_terminate_cxx(this->backupItem->getCompactionHolder().c_str());
if (!this->getStatusHolder()->getStatus().ok()) {
throw std::runtime_error(
this->getStatusHolder()->getStatus().error_message());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 9:51 PM (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2431715
Default Alt Text
D5038.id16739.diff (2 KB)
Attached To
Mode
D5038: [services] Rust Integration - Backup - c++ - Multiple get clients
Attached
Detach File
Event Timeline
Log In to Comment