Skip to content

Commit

Permalink
Mon 11910 broker start 21.10 (#117)
Browse files Browse the repository at this point in the history
* cleanup(broker/core): coding style and C++14 transition

* cleanup(bam): default constructors/destructors cleaned

* cleanup(bam): override applied on many objects

* enh(bam/metrics): metrics removed from bam

* fix(storage): conflict_manager is running when bam starts its initialization

* fix(bam): metric_book is removed

* fix(bam): metric_listener is removed from bam

* cleanup(bam): code cleaned and coding style applied.

* fix(bam/storage): cache fill optimized

* fix(broker/bam): bad idea to wait for conflict_manager

We remove the patch for bam to wait for the conflict_manager.
In case of a cbd with only bam, it won't start.

A query in the cache loading of bam has also been improved.

* chore(doc): Changelog updated.

REFS: MON-11910
  • Loading branch information
bouda1 committed Jan 10, 2022
1 parent f553a7f commit bf8a6d9
Show file tree
Hide file tree
Showing 61 changed files with 558 additions and 1,632 deletions.
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,42 @@

## 21.10.1

### Fixes
### centreon-broker

#### Fixes

*rrd*

Add SQL query to check metrics to delete with their associated files.

*storage*

Waiting longer for conflict manager to be connected without blocking if cbd
is stopped.

Cache loading queries are parallelized.

*bam*

A ba configured with best status was initialized in state OK. And when KPI were
added, their status were always worst than OK (best case was OK). So even if all
the kpi were in critical state, the state appeared as OK.

The cache in bam is lighter, only needed services are loaded. Metrics are no
more loaded. And queries to load the cache are parallelized.

*mysql_connection*

A timeout is added on mysql\_ping and this function is less called than before.

*tls*

Printing encrypted write logs on trace level only.

### centreon-engine

#### Fixes

*modules*

Fixing segfault
Fixing segfault.
8 changes: 0 additions & 8 deletions centreon-broker/bam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ add_library("${BAM}" SHARED
"${SRC_DIR}/ba_svc_mapping.cc"
"${SRC_DIR}/ba_event.cc"
"${SRC_DIR}/ba_duration_event.cc"
"${SRC_DIR}/bool_aggregate.cc"
"${SRC_DIR}/bool_and.cc"
"${SRC_DIR}/bool_binary_operator.cc"
"${SRC_DIR}/bool_call.cc"
"${SRC_DIR}/bool_constant.cc"
"${SRC_DIR}/bool_equal.cc"
"${SRC_DIR}/bool_expression.cc"
"${SRC_DIR}/bool_less_than.cc"
"${SRC_DIR}/bool_metric.cc"
"${SRC_DIR}/bool_more_than.cc"
"${SRC_DIR}/bool_not.cc"
"${SRC_DIR}/bool_not_equal.cc"
Expand Down Expand Up @@ -89,8 +87,6 @@ add_library("${BAM}" SHARED
"${SRC_DIR}/kpi_service.cc"
"${SRC_DIR}/kpi_status.cc"
"${SRC_DIR}/main.cc"
"${SRC_DIR}/metric_book.cc"
"${SRC_DIR}/metric_listener.cc"
"${SRC_DIR}/monitoring_stream.cc"
"${SRC_DIR}/rebuild.cc"
"${SRC_DIR}/reporting_stream.cc"
Expand All @@ -105,15 +101,13 @@ add_library("${BAM}" SHARED
"${INC_DIR}/ba_svc_mapping.hh"
"${INC_DIR}/ba_event.hh"
"${INC_DIR}/ba_duration_event.hh"
"${INC_DIR}/bool_aggregate.hh"
"${INC_DIR}/bool_and.hh"
"${INC_DIR}/bool_binary_operator.hh"
"${INC_DIR}/bool_call.hh"
"${INC_DIR}/bool_constant.hh"
"${INC_DIR}/bool_equal.hh"
"${INC_DIR}/bool_expression.hh"
"${INC_DIR}/bool_less_than.hh"
"${INC_DIR}/bool_metric.hh"
"${INC_DIR}/bool_more_than.hh"
"${INC_DIR}/bool_not.hh"
"${INC_DIR}/bool_not_equal.hh"
Expand Down Expand Up @@ -159,8 +153,6 @@ add_library("${BAM}" SHARED
"${INC_DIR}/kpi_event.hh"
"${INC_DIR}/kpi_service.hh"
"${INC_DIR}/kpi_status.hh"
"${INC_DIR}/metric_book.hh"
"${INC_DIR}/metric_listener.hh"
"${INC_DIR}/monitoring_stream.hh"
"${INC_DIR}/rebuild.hh"
"${INC_DIR}/reporting_stream.hh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ba_duration_event : public io::data {
public:
ba_duration_event();
ba_duration_event(ba_duration_event const& other);
~ba_duration_event();
~ba_duration_event() noexcept override = default;
ba_duration_event& operator=(ba_duration_event const& other);
bool operator==(ba_duration_event const& other) const;
constexpr static uint32_t static_type() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ba_event : public io::data {
public:
ba_event();
ba_event(ba_event const& other);
~ba_event() noexcept = default;
~ba_event() noexcept override = default;
ba_event& operator=(ba_event const& other);
bool operator==(ba_event const& other) const;
constexpr static uint32_t static_type() {
Expand Down
4 changes: 2 additions & 2 deletions centreon-broker/bam/inc/com/centreon/broker/bam/ba_status.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Copyright 2014 Centreon
** Copyright 2014, 2021 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,7 @@ class ba_status : public io::data {
public:
ba_status();
ba_status(ba_status const& other);
~ba_status();
~ba_status() noexcept override = default;
ba_status& operator=(ba_status const& other);
constexpr static uint32_t static_type() {
return io::events::data_type<io::events::bam, bam::de_ba_status>::value;
Expand Down
71 changes: 0 additions & 71 deletions centreon-broker/bam/inc/com/centreon/broker/bam/bool_aggregate.hh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ class bool_binary_operator : public bool_value {

bool_binary_operator();
bool_binary_operator(bool_binary_operator const& right);
virtual ~bool_binary_operator();
bool_binary_operator& operator=(bool_binary_operator const& right) = delete;
bool child_has_update(computable* child, io::stream* visitor = NULL);
~bool_binary_operator() noexcept override = default;
bool_binary_operator& operator=(bool_binary_operator const& right);
bool child_has_update(computable* child, io::stream* visitor = NULL) override;
void set_left(std::shared_ptr<bool_value> const& left);
void set_right(std::shared_ptr<bool_value> const& right);
bool state_known() const;
bool in_downtime() const;
bool state_known() const override;
bool in_downtime() const override;

private:
void _internal_copy(bool_binary_operator const& right);
Expand Down
10 changes: 5 additions & 5 deletions centreon-broker/bam/inc/com/centreon/broker/bam/bool_call.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class bool_call : public bool_value {

bool_call(std::string const& name);
bool_call(bool_call const& right);
~bool_call();
~bool_call() noexcept override = default;
bool_call& operator=(bool_call const& right);
double value_hard();
double value_soft();
bool state_known() const;
double value_hard() override;
double value_soft() override;
bool state_known() const override;
std::string const& get_name() const;
void set_expression(std::shared_ptr<bool_value> expression);
bool child_has_update(computable* child, io::stream* visitor = NULL);
bool child_has_update(computable* child, io::stream* visitor = NULL) override;

private:
std::string _name;
Expand Down
15 changes: 7 additions & 8 deletions centreon-broker/bam/inc/com/centreon/broker/bam/bool_constant.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@ namespace bam {
* value (i.e '42').
*/
class bool_constant : public bool_value {
double _value;

public:
bool_constant(double value);
bool_constant(bool_constant const& right);
~bool_constant();
~bool_constant() noexcept override = default;
bool_constant& operator=(bool_constant const& right);
bool child_has_update(computable* child, io::stream* visitor);
double value_hard();
double value_soft();
bool state_known() const;

private:
double _value;
bool child_has_update(computable* child, io::stream* visitor) override;
double value_hard() override;
double value_soft() override;
bool state_known() const override;
};
} // namespace bam

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace bam {
class bool_equal : public bool_binary_operator {
public:
bool_equal() = default;
~bool_equal() noexcept = default;
~bool_equal() noexcept override = default;
bool_equal(bool_equal const&) = delete;
bool_equal& operator=(bool_equal const&) = delete;
double value_hard() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class bool_expression : public computable {
public:
bool_expression();
bool_expression(bool_expression const& other) = delete;
~bool_expression() noexcept = default;
~bool_expression() noexcept override = default;
bool_expression& operator=(bool_expression const& other) = delete;
bool child_has_update(computable* child, io::stream* visitor = NULL);
bool child_has_update(computable* child, io::stream* visitor = NULL) override;
impact_values::state get_state() const;
bool state_known() const;
void set_expression(std::shared_ptr<bool_value> const& expression);
Expand Down
82 changes: 0 additions & 82 deletions centreon-broker/bam/inc/com/centreon/broker/bam/bool_metric.hh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class bool_not_equal : public bool_binary_operator {
public:
bool_not_equal() = default;
bool_not_equal(bool_not_equal const&) = delete;
~bool_not_equal() noexcept = default;
~bool_not_equal() noexcept override = default;
bool_not_equal& operator=(bool_not_equal const&) = delete;
double value_hard();
double value_soft();
double value_hard() override;
double value_soft() override;
};
} // namespace bam

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class bool_operation : public bool_binary_operator {

public:
bool_operation(std::string const& op);
~bool_operation() noexcept = default;
~bool_operation() noexcept override = default;
bool_operation(bool_operation const&) = delete;
bool_operation& operator=(bool_operation const&) = delete;
double value_hard() override;
Expand Down
Loading

0 comments on commit bf8a6d9

Please sign in to comment.