arpadboda commented on a change in pull request #715: MINIFICPP-1126 - Reduce 
sawtooth in memory usage of rocksdb flowfile …
URL: https://github.com/apache/nifi-minifi-cpp/pull/715#discussion_r371310031
 
 

 ##########
 File path: extensions/rocksdb-repos/FlowFileRepository.cpp
 ##########
 @@ -69,14 +68,8 @@ void FlowFileRepository::flush() {
     batch.Delete(keys[i]);
   }
 
-
-  if (db_->Write(rocksdb::WriteOptions(), &batch).ok()) {
-    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;
-    }
+  if (!db_->Write(rocksdb::WriteOptions(), &batch).ok()) {
+    logger_->log_warn("Failed to execute batch operation when flushing 
FlowFileRepository");
 
 Review comment:
   I removed size handling as:
   - It was done in an inconsistent way.
   - Even if the repo_full flag was set, nothing happened, new elements were 
inserted. 
   - Handling repo size out of the repo (without taking the size of keys into 
account) is most probably a bad design.
   
   
   

----------------------------------------------------------------
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