Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299325
D4230.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
D4230.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
@@ -37,6 +37,7 @@
std::vector<std::shared_ptr<database::LogItem>> logs;
size_t currentLogIndex = 0;
std::shared_ptr<database::LogItem> currentLog;
+ size_t currentChunkCounter = 0;
void initializeGetReactor(const std::string &holder);
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
@@ -60,6 +60,7 @@
std::string dataChunk;
this->dataChunks->blockingRead(dataChunk);
if (!dataChunk.empty()) {
+ response->set_chunkcounter(this->currentChunkCounter++);
response->set_compactionchunk(dataChunk);
return nullptr;
}
@@ -72,6 +73,7 @@
this->getReactor->getStatusHolder()->getStatus().error_message());
}
this->state = State::LOGS;
+ this->currentChunkCounter = 0;
}
if (this->state == State::LOGS) {
// TODO make sure logs are received in correct order regardless their size
@@ -108,7 +110,9 @@
// data to the client and reset currentLog so the next invocation of
// writeResponse will take another one from the collection
response->set_logchunk(this->currentLog->getValue());
+ response->set_chunkcounter(this->currentChunkCounter);
++this->currentLogIndex;
+ this->currentChunkCounter = 0;
this->currentLog = nullptr;
return nullptr;
}
@@ -126,10 +130,12 @@
// If there's data inside, we write it to the client and proceed.
if (dataChunk.empty()) {
++this->currentLogIndex;
+ this->currentChunkCounter = 0;
this->currentLog = nullptr;
return nullptr;
} else {
response->set_logchunk(dataChunk);
+ response->set_chunkcounter(this->currentChunkCounter++);
}
return nullptr;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 10:48 AM (20 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534816
Default Alt Text
D4230.diff (2 KB)
Attached To
Mode
D4230: [services] Backup - Add chunk counter to the pull backup reactor
Attached
Detach File
Event Timeline
Log In to Comment