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-2931: do not create a chain if it's already created #2934

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

kopaygorodsky
Copy link
Contributor

@kopaygorodsky kopaygorodsky commented Sep 18, 2021

Signed-off-by: Vladyslav Kopaihorodskyi vlad.kopaygorodsky@gmail.com

Type of change

  • Bug fix

Description

Do not create a new chain of type etcdraft.Chain if such exists in the map of chains. This can happen when in Raft protocol a channel was created, but not marked as done in WAL logs. So at orderer startup, it tried to create another instance of a chain and panicked because that instance startup failed.

Related issues

#2931

Release Note

Fixed bug when an orderer crashed at channel creation and after restart couldn't bootstrap because of desynchronization between WAL logs and ledger state.

@kopaygorodsky kopaygorodsky requested a review from a team as a code owner September 18, 2021 00:58
@kopaygorodsky kopaygorodsky force-pushed the CATBP-2931 branch 2 times, most recently from 746a94a to b992541 Compare September 18, 2021 01:10
@kopaygorodsky kopaygorodsky changed the title CATBP-2931: do not create a chain if it's already created FAB-2931: do not create a chain if it's already created Sep 18, 2021
@kopaygorodsky kopaygorodsky deleted the CATBP-2931 branch September 18, 2021 01:20
@kopaygorodsky kopaygorodsky restored the CATBP-2931 branch September 18, 2021 01:21
@kopaygorodsky kopaygorodsky reopened this Sep 18, 2021
…of chains. This can happen when in Raft protocol a channel was created, but not marked as done in WAL logs, so at orderer startup it will try to rerun creation tx and panic because the channel already exists.

Signed-off-by: Vladyslav Kopaihorodskyi <vlad.kopaygorodsky@gmail.com>
@yacovm
Copy link
Contributor

yacovm commented Sep 18, 2021

Looks good to me. Let's get more eyes on this.

@yacovm
Copy link
Contributor

yacovm commented Sep 18, 2021

@jyellick @guoger

@jyellick
Copy link
Contributor

Looks good to me

@denyeart denyeart merged commit aa8d06b into hyperledger:main Sep 20, 2021
@denyeart
Copy link
Contributor

@Mergifyio backport release-2.3

@denyeart
Copy link
Contributor

@Mergifyio backport release-2.2

@mergify
Copy link

mergify bot commented Sep 20, 2021

Command backport release-2.3: success

Backports have been created

@mergify
Copy link

mergify bot commented Sep 20, 2021

Command backport release-2.2: success

Backports have been created

@yacovm
Copy link
Contributor

yacovm commented Sep 20, 2021

@kopaygorodsky do you want to backport it to 1.4 and 2.2 branches?

@denyeart
Copy link
Contributor

We'll have to backport to release-2.2 and release-1.4 by hand (cherry-pick), auto backport only worked on release-2.3.

@kopaygorodsky
Copy link
Contributor Author

@yacovm @denyeart yes, ofc. I'll provide PRs tomorrow.

@guoger
Copy link
Member

guoger commented Sep 22, 2021

this should've fixed https://jira.hyperledger.org/browse/FAB-18526 as well

@denyeart
Copy link
Contributor

@kopaygorodsky Reminder before we lose track of this one... if you can't find time for the remaining backports we can likely find another person...

@kopaygorodsky
Copy link
Contributor Author

kopaygorodsky commented Sep 24, 2021

@denyeart I'll definitely find some time this weekend, had an unexpectedly busy week, sorry.

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.

6 participants