adamdebreceni commented on a change in pull request #1090:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1090#discussion_r663948441
##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -220,17 +240,21 @@ void FlowFileRepository::initialize_repository() {
logger_->log_trace("Do not need checkpoint");
return;
}
- rocksdb::Checkpoint *checkpoint;
// delete any previous copy
- if (utils::file::FileUtils::delete_dir(checkpoint_dir_) >= 0 &&
opendb->NewCheckpoint(&checkpoint).ok()) {
- if (checkpoint->CreateCheckpoint(checkpoint_dir_).ok()) {
+ if (utils::file::FileUtils::delete_dir(checkpoint_dir_) >= 0) {
+ rocksdb::Checkpoint* checkpoint = nullptr;
+ rocksdb::Status checkpoint_status = opendb->NewCheckpoint(&checkpoint);
+ if (checkpoint_status.ok()) {
+ checkpoint_status = checkpoint->CreateCheckpoint(checkpoint_dir_);
+ }
+ if (checkpoint_status.ok()) {
checkpoint_ = std::unique_ptr<rocksdb::Checkpoint>(checkpoint);
- logger_->log_trace("Created checkpoint directory");
+ logger_->log_trace("Created checkpoint in directory '%s'",
checkpoint_dir_);
} else {
- logger_->log_trace("Could not create checkpoint. Corrupt?");
+ logger_->log_error("Could not create checkpoint: %s",
checkpoint_status.ToString());
}
} else
- logger_->log_trace("Could not create checkpoint directory. Not properly
deleted?");
+ logger_->log_error("Could not delete existing checkpoint directory '%s'",
checkpoint_dir_);
Review comment:
@lordgamez had the same concern, done in commit
[3db64f](https://github.com/apache/nifi-minifi-cpp/pull/1090/commits/3db64f47d25f9067fd23ade4e1100a666c542efa)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]