-
Notifications
You must be signed in to change notification settings - Fork 113
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
Log nodes that don't reach consensus #452
Conversation
Signed-off-by: Steven Sheehy <steven.sheehy@hedera.com>
Codecov Report
@@ Coverage Diff @@
## master #452 +/- ##
==========================================
+ Coverage 57.92% 58.45% +0.52%
==========================================
Files 56 59 +3
Lines 2491 2520 +29
Branches 325 329 +4
==========================================
+ Hits 1443 1473 +30
+ Misses 903 902 -1
Partials 145 145
Continue to review full report at Codecov.
|
hedera-mirror-importer/src/main/java/com/hedera/mirror/importer/downloader/Downloader.java
Outdated
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
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.
LGTM
hedera-mirror-importer/src/main/java/com/hedera/mirror/importer/downloader/Downloader.java
Outdated
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Show resolved
Hide resolved
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
hedera-mirror-importer/src/main/java/com/hedera/mirror/importer/domain/SignatureStream.java
Outdated
Show resolved
Hide resolved
if (!greaterThanSuperMajorityNum(signatures.size(), nodeIDPubKeyMap.size())) { | ||
Set<String> seenNodes = signatures.stream().map(SignatureStream::getNode).collect(Collectors.toSet()); | ||
Set<String> missingNodes = new TreeSet<>(Sets.difference(nodeIDPubKeyMap.keySet(), seenNodes)); | ||
String message = String.format("Signature verification failed for %s with %s of %s nodes missing: %s", |
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 may be wrong, but i got a feeling that this may give many false +ves. Sig files from different nodes will arrive over a window of time. If that window is >500ms (polling rate), we will hit this at least once every 5 sec and log unwanted nodes as 'possible defaulters'. Given Leemon's ask is to find nodes consistently defaulting on publishing good streams, am afraid this won't address that in any meaningful way.
Please try it running locally against mainnet bucket in steady state, and see what is logged. Hopefully the case mentioned above doesn't happen too often.
Either ways, we should move this logging to line 95, where it'll be much more useful since the candidates for 'defaulting nodes' would be much less.
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.
In the current code, there is a similar log.warn("Signature file count does not exceed 2/3 of nodes");
in Downloader that is shown with the exact same logic. All I did was push this into the NodeSignatureVerifier
class and add some additional detail to the log. There shouldn't be any change in log frequency.
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.
If I moved it to line 95, then it wouldn't be logically correct as that is the success scenario and logging at just the success scenario would mean the unhappy path doesn't get logged.
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 difference from before is expectation.
Earlier, that line didn't matter, unless mirror had some issue and someone looked at the logs. Even then, that line being spammy was okay.
Now, we need a log to help identify issues in mainnet node stream publications.
We want to it to be more useful by just logging node ids that don't contribute to consensus. We don't want to log many node ids because only 2 nodes had uploaded sigs when polling happened. So doing it right after super-majority is best i could think of. Just info level would be okay too.
Doing it as part of super spammy log.warn("Singature file.....
just isn't right.
https://console.cloud.google.com/logs/viewer?project=mirrornode&authuser=0&organizationId=130634591014&resource=gce_instance&minLogLevel=0&expandAll=false&filters=text:%22%20ERROR%20%22×tamp=2019-12-19T16:28:26.000000000Z&customFacets=&limitCustomFacetWidth=true&dateRangeStart=2019-12-18T16:34:29.353Z&dateRangeEnd=2019-12-19T16:34:29.353Z&interval=P1D&advancedFilter=resource.type%3D%22gce_instance%22%0A%22%20Signature%20file%20count%20does%20%22%0Alabels.%22compute.googleapis.com%2Fresource_name%22%3D%22mirrornode-mainnet-1%22&scrollTimestamp=2019-12-19T16:32:23.000000000Z
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 like the rest of the change (well not the exception part, but i don't care about it much :)). However, this piece of logic here is what's actually addressing the issue we want to fix, rest is just cleanup. If we don't do this right, it beats the whole purpose.
...rror-importer/src/main/java/com/hedera/mirror/importer/downloader/NodeSignatureVerifier.java
Outdated
Show resolved
Hide resolved
...ra-mirror-importer/src/main/java/com/hedera/mirror/importer/exception/ImporterException.java
Show resolved
Hide resolved
Signed-off-by: Steven Sheehy <steven.sheehy@hedera.com>
Detailed description:
FileStreamSignature
class that allows different methods to enrich it with data like hash, signature and validityWhich issue(s) this PR fixes:
Fixes #444
Special notes for your reviewer:
Example output:
Checklist