Skip to content
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

feat: log details of cancelled transitions #11069

Merged
2 commits merged into from
Nov 23, 2022
Merged

feat: log details of cancelled transitions #11069

2 commits merged into from
Nov 23, 2022

Conversation

lenaschoenburg
Copy link
Member

When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.

Here we add a toString implementation for PartitionTransitionProcess that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.

When one transition cancels another, we were only logging a generic
"cancel" message. This was lacking context, specifically which
transition causes a cancellation.

Here we add a `toString` implementation for `PartitionTransitionProcess`
that shows term, role, status and the remaining steps. This is used in
a new log statement that should provide us with the necessary context.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2022

Test Results

   959 files  +    1     959 suites  +1   1h 43m 37s ⏱️ +29s
7 808 tests +182  7 801 ✔️ +182  7 💤 ±0  0 ±0 
8 008 runs  +182  7 999 ✔️ +182  9 💤 ±0  0 ±0 

Results for commit a9d8100. ± Comparison against base commit e704573.

♻️ This comment has been updated with latest results.

@lenaschoenburg lenaschoenburg marked this pull request as ready for review November 22, 2022 11:43
Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleschoenburg Thanks for improving the logs. Please apply my comment. There is no need for another review as it is a minor change.

@@ -109,6 +109,9 @@ private void enqueueNextTransition(
ongoingTransitionFuture = currentTransitionFuture;

final var ongoingTransition = currentTransition;

LOG.info(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ This will be logged everytime there is transition. Previous transition needs to be cancelled only if it was not completed. So you should log only if !ongoingTransition.isCompleted()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice catch! I didn't realize that currentTransition is not cleared when it is completed 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it is better to clear currentTransition after it is completed. Not sure if it causes other issues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's tricky to do this correctly. By the time a transition finishes, the currentTransition might be a newer transition so we shouldn't just set it to null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd rather not touch that right now so I only added a check so that we only log if the "current" transition is not completed, like you suggested.

@lenaschoenburg
Copy link
Member Author

bors r+

ghost pushed a commit that referenced this pull request Nov 22, 2022
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg

When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.

Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Nov 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

Failed due to #11072

bors r+

ghost pushed a commit that referenced this pull request Nov 22, 2022
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg

When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.

Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Nov 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors retry

ghost pushed a commit that referenced this pull request Nov 22, 2022
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg

When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.

Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Nov 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors retry

ghost pushed a commit that referenced this pull request Nov 22, 2022
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg

When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.

Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@ghost
Copy link

ghost commented Nov 22, 2022

Build failed:

@lenaschoenburg
Copy link
Member Author

bors r+

@ghost
Copy link

ghost commented Nov 23, 2022

Build succeeded:

@ghost ghost merged commit 887b63b into main Nov 23, 2022
@ghost ghost deleted the os-log-transition-cancel branch November 23, 2022 15:20
@backport-action
Copy link
Collaborator

Successfully created backport PR #11084 for stable/8.0.

@backport-action
Copy link
Collaborator

Successfully created backport PR #11085 for stable/8.1.

ghost pushed a commit that referenced this pull request Nov 23, 2022
11085: [Backport stable/8.1] feat: log details of cancelled transitions r=oleschoenburg a=backport-action

# Description
Backport of #11069 to `stable/8.1`.

relates to 

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
ghost pushed a commit that referenced this pull request Nov 23, 2022
11084: [Backport stable/8.0] feat: log details of cancelled transitions r=oleschoenburg a=backport-action

# Description
Backport of #11069 to `stable/8.0`.

relates to 

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@remcowesterhoud remcowesterhoud added version:8.1.5 Marks an issue as being completely or in parts released in 8.1.5 release/8.0.9 labels Dec 6, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:8.1.5 Marks an issue as being completely or in parts released in 8.1.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants