adamdebreceni commented on a change in pull request #1090:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1090#discussion_r664290173
##########
File path: extensions/rocksdb-repos/FlowFileRepository.cpp
##########
@@ -220,17 +231,24 @@ 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()) {
- checkpoint_ = std::unique_ptr<rocksdb::Checkpoint>(checkpoint);
- logger_->log_trace("Created checkpoint directory");
- } else {
- logger_->log_trace("Could not create checkpoint. Corrupt?");
- }
- } else
- logger_->log_trace("Could not create checkpoint directory. Not properly
deleted?");
+ if (utils::file::FileUtils::delete_dir(checkpoint_dir_) < 0) {
+ logger_->log_error("Could not delete existing checkpoint directory '%s'",
checkpoint_dir_);
+ return;
+ }
+ rocksdb::Checkpoint* checkpoint = nullptr;
+ rocksdb::Status checkpoint_status = opendb->NewCheckpoint(&checkpoint);
+ if (!checkpoint_status.ok()) {
+ logger_->log_error("Could not create checkpoint object: %s",
checkpoint_status.ToString());
+ return;
+ }
+ checkpoint_status = checkpoint->CreateCheckpoint(checkpoint_dir_);
+ if (!checkpoint_status.ok()) {
+ logger_->log_error("Could not initialize checkpoint: %s",
checkpoint_status.ToString());
+ return;
+ }
Review comment:
done in
[0e20dfe8](https://github.com/apache/nifi-minifi-cpp/pull/1090/commits/0e20dfe88485cade5969d1e42769d3c3ea02c0ea)
--
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]