-
Notifications
You must be signed in to change notification settings - Fork 38
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
node/netmap: Write log messages about NewEpoch
events
#1763
node/netmap: Write log messages about NewEpoch
events
#1763
Conversation
…n event Sometimes it is useful to track sidechain events processed by the node. For example, we need some easy way to look up for log messages about new epoch notifications. Make `subscriber.Subscriber` to log names of all events received from the sidechain notification channel. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
… event There is a need to have the ability to track NeoFS timeline on storage nodes. Epochs tick on notifications receipt, so the most obvious way to know about received epochs is logging the events. Wrap `morphEvent.ParseNewEpoch` event parser into function which writes log message about new epoch number. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
443d913
to
31ecd13
Compare
Codecov Report
@@ Coverage Diff @@
## master #1763 +/- ##
==========================================
+ Coverage 33.09% 33.24% +0.14%
==========================================
Files 351 351
Lines 23473 23496 +23
==========================================
+ Hits 7769 7811 +42
+ Misses 15053 15032 -21
- Partials 651 653 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -133,6 +133,10 @@ func (s *subscriber) routeNotifications(ctx context.Context) { | |||
continue | |||
} | |||
|
|||
s.log.Debug("new notification event from sidechain", |
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 only the regular notification?
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.
What else do we need? New blocks are logged. Other things don't touch epoch ticks.
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 just was thinking about that switch context
New blocks are logged.
yes, but not here, not in that switch, so that is why i asked what is the difference b/w that cases. IMO, we should either log notifications on the receiver side or log all the notifications in that switch. but not critical
setNetmapNotificationParser(c, newEpochNotification, func(src *state.ContainedNotificationEvent) (event.Event, error) { | ||
res, err := netmapEvent.ParseNewEpoch(src) | ||
if err == nil { | ||
c.log.Info("new epoch event from sidechain", |
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.
do we really need that to be "Info"?
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 think yes, epoch ticks is a main heartbeat of the node, and node admin should always have the ability to track the timeline. Don't you think so?
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 think epoch events are crucial for NeoFS network to function, so it makes sense to log this with Info
.
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.
hm, IMO, that is more like debug. in normal situations i do not expect an admin to be informed about epoch via the logs (via the metrics or the monitoring service -- yes), only if he tries to debug smth. but ok
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.
on the other hand, we have the epoch metric and do not have a block metric. that could be assumed as a criterion for being smth "info"
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.
We still don't have strict requirement for log levels. Epoch ticks is the main thing that showa node's heartbits in logs.
Sometimes it is useful to track sidechain events processed by the node. For example, we need some easy way to look up for log messages about new epoch notifications. Make `subscriber.Subscriber` to log names of all events received from the sidechain notification channel. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
…n event Sometimes it is useful to track sidechain events processed by the node. For example, we need some easy way to look up for log messages about new epoch notifications. Make `subscriber.Subscriber` to log names of all events received from the sidechain notification channel. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
… event There is a need to have the ability to track NeoFS timeline on storage nodes. Epochs tick on notifications receipt, so the most obvious way to know about received epochs is logging the events. Wrap `morphEvent.ParseNewEpoch` event parser into function which writes log message about new epoch number. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Within the issue I made a hypothesis that node had missed some ticks of the epoch timer. However it was difficult to explicitly prove or disprove this assumption.
These changes make storage nodes to log new epochs. From now it'll be easy to track the node timeline.