-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Logging improvements for the collator revamp #12282
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,6 +162,15 @@ impl<B: Backend> State<B> { | |
| "Old assignments vs new assignments", | ||
| ); | ||
|
|
||
| if old_assignments != new_assignments { | ||
| gum::info!( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not debug ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, this is not a good idea. |
||
| target: LOG_TARGET, | ||
| ?old_assignments, | ||
| ?new_assignments, | ||
| "Collator protocol assignments changed", | ||
| ); | ||
| } | ||
|
|
||
| let maybe_disconnected_peers = | ||
| self.peer_manager.scheduled_paras_update(sender, new_assignments).await; | ||
|
|
||
|
|
@@ -468,19 +477,48 @@ impl<B: Backend> State<B> { | |
| ) | ||
| .await; | ||
|
|
||
| if let Some((peer_id, PeerInfo { version, .. })) = peer_id | ||
| .and_then(|peer_id| self.peer_manager.peer_info(&peer_id).map(|info| (peer_id, info))) | ||
| { | ||
| gum::debug!( | ||
| target: LOG_TARGET, | ||
| ?para_id, | ||
| ?scheduling_parent, | ||
| ?candidate_hash, | ||
| ?peer_id, | ||
| "Notifying collator about seconded collation", | ||
| ); | ||
| notify_collation_seconded(sender, peer_id, *version, scheduling_parent, statement) | ||
| .await; | ||
| match peer_id { | ||
| Some(peer_id) => match self.peer_manager.peer_info(&peer_id) { | ||
| Some(PeerInfo { version, .. }) => { | ||
| gum::debug!( | ||
| target: LOG_TARGET, | ||
| ?para_id, | ||
| ?scheduling_parent, | ||
| ?candidate_hash, | ||
| ?peer_id, | ||
| "Notifying collator about seconded collation", | ||
| ); | ||
| notify_collation_seconded( | ||
| sender, | ||
| peer_id, | ||
| *version, | ||
| scheduling_parent, | ||
| statement, | ||
| ) | ||
| .await; | ||
| }, | ||
| // We know who fetched it, but they disconnected before we could ack the second. | ||
| None => { | ||
| gum::trace!( | ||
| target: LOG_TARGET, | ||
| ?para_id, | ||
| ?scheduling_parent, | ||
| ?candidate_hash, | ||
| ?peer_id, | ||
| "Not notifying collator about seconded collation: peer no longer connected", | ||
| ); | ||
| }, | ||
| }, | ||
| // No tracked fetcher for this candidate (e.g. its slot was already released). | ||
| None => { | ||
| gum::trace!( | ||
| target: LOG_TARGET, | ||
| ?para_id, | ||
| ?scheduling_parent, | ||
| ?candidate_hash, | ||
| "Not notifying any collator about seconded collation: fetcher unknown", | ||
| ); | ||
| }, | ||
| } | ||
|
|
||
| if !unblocked_collations.is_empty() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| title: Logging improvements for the collator revamp | ||
| doc: | ||
| - audience: Node Dev | ||
| description: |- | ||
| Some logging updates: | ||
|
|
||
| - Decrease log levels in `wait_for_first_leaf` to DEBUG, to avoid startup spam | ||
| - Use `warn_if_frequent` for fetch errors | ||
| - Log assignment changes on view change | ||
| - pick_best_advertisement: trace logs for each outcome | ||
| - update_view: log scheduling parent <-> assigned core mapping | ||
| - update_view: log sp removal | ||
| - handle_seconded_collation: logs for each error case | ||
| - PeerManager: log reputation updates | ||
|
|
||
| Partially addresses https://github.com/paritytech/polkadot-sdk/issues/10402 | ||
| crates: | ||
| - name: polkadot-collator-protocol | ||
| bump: patch |
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 is this important to be logged at info level ?
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.
Ok, let's downgrade this to debug too.
My initial idea was to have information about assignments on INFO level, but it will be too noisy.