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

Correct self repair notifier #487

Merged
1 commit merged into from
Aug 4, 2022
Merged

Correct self repair notifier #487

1 commit merged into from
Aug 4, 2022

Conversation

ghost
Copy link

@ghost ghost commented Aug 2, 2022

Trigger repair on the right P2P network change

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #348

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

When an authorized node is considered as unauthorized or globally offline, this means a topology change occurred, hence the notifier will repair transaction shards but proposing transactions to new storage nodes.

By disconnecting an authorized node the notifier should replicate all the transactions this node was in charge of.
Logs are also added to help to visualize the events.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Trigger repair on the right P2P network change
@ghost ghost added bug Something isn't working self repair Involve SelfRepair mechanism labels Aug 2, 2022
@ghost ghost requested a review from prix-uniris August 2, 2022 13:27

def start_link(args \\ []) do
GenServer.start_link(__MODULE__, args)
end

def init(_) do
PubSub.register_to_node_update()
{:ok, []}
{:ok, %{notified: %{}}}
Copy link
Contributor

Choose a reason for hiding this comment

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

if there is process crash??, and in a situation where all nodes waiting for each other for node_update: message?

Copy link
Author

Choose a reason for hiding this comment

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

This state is just to avoid multiple node_update message for a given node, to avoid multiple repair in a close time.

Copy link
Author

Choose a reason for hiding this comment

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

If the process crashes, it will restart with an empty state, and wait another message of unavailability of the node

Copy link
Contributor

@prix-uniris prix-uniris left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost merged commit fc737ef into develop Aug 4, 2022
@ghost ghost deleted the fix_self_repair_notifier branch August 4, 2022 07:04
@ghost ghost mentioned this pull request Aug 4, 2022
ghost pushed a commit that referenced this pull request Aug 17, 2022
Trigger repair on the right P2P network change
@samuelmanzanera samuelmanzanera mentioned this pull request May 30, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working self repair Involve SelfRepair mechanism
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants