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

[FAB-18401] Remove unreachable and unnecessary code in gossip membership (bp #2293) #2296

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jan 18, 2021

This is an automatic backport of pull request #2293 done by Mergify.

Cherry-pick of a4a8520 has failed:

On branch mergify/bp/release-1.4/pr-2293
Your branch is up to date with 'origin/release-1.4'.

You are currently cherry-picking commit a4a8520772.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   gossip/discovery/discovery_impl.go

no changes added to commit (use "git add" and/or "git commit -a")

To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

In gossip, alive messages are stored in membership stores, and they also have logical timestamps.

When a peer learns of an alive message with a higher logical timestamp of its latest alive message (for a specific peer),
it enters learnExistingMembers() and tentatively updates the latest envelope and gossip message of what is store in the membership store.

However, for completeness, the code checks if the membership store already contains an earlier instance, and if not, populates the membership store
with a new instance. This population is not needed, because the code only enters the function if it already knows the peer, hence the membership
store contains an earlier instance.

This commit simply removes the unneeded code path where the instance is unknown despite the fact that we know about the peer already.

Change-Id: I86bc65d881a440c267275a697853a1ead087df18
Signed-off-by: Yacov Manevich <[email protected]>
@yacovm yacovm force-pushed the mergify/bp/release-1.4/pr-2293 branch from 64f1fd2 to 9e281dc Compare January 18, 2021 23:26
@yacovm yacovm enabled auto-merge (squash) January 18, 2021 23:42
@yacovm yacovm merged commit e95a134 into release-1.4 Jan 19, 2021
@mergify mergify bot deleted the mergify/bp/release-1.4/pr-2293 branch January 19, 2021 01:02
yacovm added a commit to yacovm/fabric that referenced this pull request Feb 15, 2021
…dger#2296)

In gossip, alive messages are stored in membership stores, and they also have logical timestamps.

When a peer learns of an alive message with a higher logical timestamp of its latest alive message (for a specific peer),
it enters learnExistingMembers() and tentatively updates the latest envelope and gossip message of what is store in the membership store.

However, for completeness, the code checks if the membership store already contains an earlier instance, and if not, populates the membership store
with a new instance. This population is not needed, because the code only enters the function if it already knows the peer, hence the membership
store contains an earlier instance.

This commit simply removes the unneeded code path where the instance is unknown despite the fact that we know about the peer already.

Change-Id: I86bc65d881a440c267275a697853a1ead087df18
Signed-off-by: Yacov Manevich <[email protected]>

Co-authored-by: Yacov Manevich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant