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

Rollback Block With Context Deadline #14608

Merged
merged 7 commits into from
Nov 4, 2024
Merged

Rollback Block With Context Deadline #14608

merged 7 commits into from
Nov 4, 2024

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Nov 2, 2024

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

In the event there is a context deadline, we will be unable to rollback back a block in the event of an issue in block processing. This is due to the deadlined context preventing the deletion of a block from the db. This can exacerbate any nodes in an inconsistent state and possibly cause them to be completely non-functional . A test has been added for this particular case.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@nisdas nisdas added the Ready For Review A pull request ready for code review label Nov 2, 2024
@nisdas nisdas requested a review from a team as a code owner November 2, 2024 17:14
potuz
potuz previously approved these changes Nov 4, 2024
Comment on lines 79 to 80
// Do not use parent context in the event it deadlined
ctx = context.Background()
Copy link
Member

Choose a reason for hiding this comment

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

This will lose the span information which breaks tracing on this routine.

Consider doing this:

ctx := trace.NewContext(context.Background(), span)

This will create a new context without deadlines and load the metadata from the span on this routine onto that new context.

@nisdas nisdas added this pull request to the merge queue Nov 4, 2024
Merged via the queue into develop with commit 928b707 Nov 4, 2024
18 checks passed
@nisdas nisdas deleted the rollbackDeadline branch November 4, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants