Skip to content

Commit

Permalink
B OpenNebula#5040: Fix LogDB::purge_log (OpenNebula#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Czerný authored Aug 26, 2020
1 parent 1dfa4d5 commit 734bc15
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/sql/LogDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ int LogDB::purge_log()

multiple_cb<std::vector, uint64_t> cb_info;
single_cb<string> cb_min_idx;
std::vector<uint64_t> maxmin_i{0, 0};
std::vector<uint64_t> maxmin_e{0, 0};
std::vector<uint64_t> maxmin_i;
std::vector<uint64_t> maxmin_e;
string min_idx;

int rc = 0;
Expand Down Expand Up @@ -694,11 +694,14 @@ int LogDB::purge_log()

cb_info.unset_callback();

oss.str("");
oss << "Purging obsolete LogDB records: " << rc << " records purged. Log state: "
<< maxmin_i[0] << "," << maxmin_i[1] << " - " << maxmin_e[0] << "," << maxmin_e[1];
if (maxmin_i.size() == 2 && maxmin_e.size() == 2)
{
oss.str("");
oss << "Purging obsolete LogDB records: " << rc << " records purged. Log state: "
<< maxmin_i[0] << "," << maxmin_i[1] << " - " << maxmin_e[0] << "," << maxmin_e[1];

NebulaLog::log("DBM", Log::INFO, oss);
NebulaLog::log("DBM", Log::INFO, oss);
}

/* ---------------------------------------------------------------------- */
/* Federated records. Keep last log_retention federated records */
Expand Down

0 comments on commit 734bc15

Please sign in to comment.