-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #8344: Missing relevant information about why the compliance is what it is on node #1103
Conversation
PR rebased |
6f28748
to
85addd4
Compare
@@ -149,6 +160,7 @@ class ReportsExecutionService ( | |||
reportsRepository.getReportsWithLowestId match { | |||
case Full(Some((id, report))) => | |||
logger.debug(s"Initializing the status execution update to id ${id}, date ${report.executionTimestamp}") | |||
this.idForCheck = id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a this here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idForCheck ? For init, else it remains at 0 (it would change on next run, but I don't think it's a problem ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, question is why a "this." only here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, because the param is also named "id", and if I don't qualify the other id, there is a name conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would understand if the 'this.' was on 'id', but I don't understand why you need to add it to IdForCheck
idForCheck = id
Would have been what I expect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand you explaination @fanf :( I don't see the conflict
Why is there still two commits, 94e73d3 should be removed as it was merged elsewhere |
85addd4
to
de7c2cb
Compare
PR rebased |
@@ -95,17 +96,17 @@ trait RuleOrNodeReportingServiceImpl extends ReportingService { | |||
nodeIds <- confExpectedRepo.findCurrentNodeIds(ruleId) | |||
reports <- findRuleNodeStatusReports(nodeIds, Set(ruleId)) | |||
} yield { | |||
RuleStatusReport(ruleId, reports.toIterable) | |||
val toKeep = reports.values.flatMap( _._2.filter( _.ruleId == ruleId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you refiltering ? findRuleNodeStatusReports is already filtering by ruleId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No good reason, I guess
PR rebased |
de7c2cb
to
070eeea
Compare
report = reports.groupBy(_.nodeId).map { case(nodeId, reports) => NodeStatusReport(nodeId, reports) }.toSet | ||
result <- if(report.size == 1) Full(report.head) else Failure("Found bad number of reports for node " + nodeId) | ||
reports <- findRuleNodeStatusReports(Set(nodeId), Set()) | ||
(run, set) <- reports.get(nodeId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail is there are no reports on the given node -with a nasty stacktrace)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkAndUpdateCache can return an empty map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it's an option with get, but you're right, it should be better with an error message
If I undestand changes on ReportingService correctly, you change how Rule reports are sent from a 'Set of the reports on the Rule' to 'A Map that associate For a Node(id) to a couple RunAndConfig ( run and configuration id state) and the set of reports applied to that node ? |
Yes |
case Some(c) => s"configId:${c.value}" | ||
} | ||
s"${r.ruleId.value}/${r.serial}[exp:${r.expirationDate}][${run}][${cfid}]${r.compliance.toString}" | ||
s"${r.ruleId.value}/${r.serial}[exp:${r.expirationDate}]${r.compliance.toString}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't you serializing agent run time anymore ? (config_id is toLog)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just below, because it's common to all reports for that run
PR rebased |
070eeea
to
c7fd6e2
Compare
( | ||
<p>{currentConfigId(expectedConfigId)}</p> | ||
<p>But we received a run, started at {lastRunDateTime.toString(dateFormat)}, with a different configuration ID ({lastRunConfigId.configId.value})</p> | ||
<p>The time since generation of the new configuration is greater than the grace period, so every received reports will be mark as unexpected</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be marked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/every/all/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/greater/longer/
c7fd6e2
to
119f4da
Compare
PR rebased |
1 similar comment
PR rebased |
119f4da
to
8a28641
Compare
report = reports.groupBy(_.nodeId).map { case(nodeId, reports) => NodeStatusReport(nodeId, reports) }.toSet | ||
result <- if(report.size == 1) Full(report.head) else Failure("Found bad number of reports for node " + nodeId) | ||
reports <- findRuleNodeStatusReports(Set(nodeId), Set()) | ||
(run, set) <- Box(reports.get(nodeId)) ?~! s"Can not find report for node with ID ${nodeId.value}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much awesomeness (was reallly complicated before ...)
It seems ok to me ! (but i can't say my brain can compute all cases) If @ncharles as nothing more to say, it's ok to merge !! |
s" last run: nodeConfigId: ${lastRunConfigId.toLog} received at ${lastRunDateTime} |"+ | ||
s" expire at ${lastRunExpiration}]" | ||
s" expire at ${lastRunExpiration}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/expire/expired/
case NoReportInInterval(expectedConfigId) => | ||
( | ||
<p>{currentConfigId(expectedConfigId)}</p> | ||
<p>No recent runs were received for that node, and the grace period to get them expired.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/that node/node/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/get them/receive them/
PR rebased |
8a28641
to
7d8b216
Compare
PR rebased |
7d8b216
to
7ecb070
Compare
PR rebased |
7ecb070
to
963ecc0
Compare
PR rebased |
963ecc0
to
bb17a07
Compare
except for my question, this looks ok |
PR rebased |
bb17a07
to
159bfc8
Compare
… what it is on node
PR rebased |
159bfc8
to
08add9f
Compare
looks ok to me with the explaination |
https://www.rudder-project.org/redmine/issues/8344