Skip to content

Commit

Permalink
UnreachableParent: Fetch from_to_node column as child_id
Browse files Browse the repository at this point in the history
This column is required to make prepare the path chain of root-problem
  • Loading branch information
sukhwinder33445 committed Dec 17, 2024
1 parent 9c86ab9 commit 3749421
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/Icingadb/Model/UnreachableParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @property string $id
* @property int $level
* @property string $child_id
* @property ?string $host_id
* @property ?string $service_id
* @property ?string $redundancy_group_id
Expand Down Expand Up @@ -48,6 +49,7 @@ public function getColumns(): array
{
return [
'id',
'child_id',
'level',
'host_id',
'service_id',
Expand Down Expand Up @@ -109,6 +111,7 @@ private static function selectNodes(Connection $db, Model $root): Select
$rootQuery = DependencyNode::on($db)
->columns([
'id' => 'id',
'child_id' => 'id',
'level' => new Expression('0'),
'host_id' => 'host_id',
'service_id' => new Expression("COALESCE(%s, CAST('' as binary(20)))", ['service_id']),
Expand All @@ -135,6 +138,7 @@ private static function selectNodes(Connection $db, Model $root): Select
$nodeQuery = DependencyEdge::on($db)
->columns([
'id' => 'to_node_id',
'child_id' => 'from_node_id',
'level' => new Expression('urn.level + 1'),
'host_id' => 'to.host_id',
'service_id' => 'to.service_id',
Expand All @@ -155,6 +159,7 @@ private static function selectNodes(Connection $db, Model $root): Select
$columnsProperty->setValue($nodeSelect, array_merge(
[
'id' => null,
'child_id' => null,
'level' => null,
'host_id' => null,
'service_id' => null,
Expand Down

0 comments on commit 3749421

Please sign in to comment.