bakaid commented on a change in pull request #719: MINIFICPP-1133 - Rocksdb 
operation errors should cause exceptions ins…
URL: https://github.com/apache/nifi-minifi-cpp/pull/719#discussion_r372330573
 
 

 ##########
 File path: extensions/rocksdb-repos/FlowFileRepository.cpp
 ##########
 @@ -70,13 +71,20 @@ void FlowFileRepository::flush() {
   }
 
 
-  if (db_->Write(rocksdb::WriteOptions(), &batch).ok()) {
+  auto operation = [this, &batch]() { return 
db_->Write(rocksdb::WriteOptions(), &batch); };
+
+  if (ExecuteWithRetry(operation)) {
     logger_->log_trace("Decrementing %u from a repo size of %u", 
decrement_total, repo_size_.load());
     if (decrement_total > repo_size_.load()) {
       repo_size_ = 0;
     } else {
       repo_size_ -= decrement_total;
     }
+  } else {
+    for (const auto& key: keystrings) {
+      keys_to_delete.enqueue(key);  // Push back the values that we could get 
but couldn't delete
+      return;  // Stop here - don't delete from content repo while we have 
records in FF repo
 
 Review comment:
   This return should definitely not be here. I suspect it should be outside of 
the for loop.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to