-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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-17992] Remove ledger blockstore data for a channel #1423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Wenjian, for changing the approach as discussed. While the approach looks good to me, I have a few other suggestions related to improving the code robustness, test, and code readability.
9e71074
to
1fb4e29
Compare
@cendhu Thank you. I have addressed your comments. |
Add a Remove function to block store provider to remove block index and blocks directory for a channel. It will be called by the orderer and peer as part of channel deletion. Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
if err := dbHandle.DeleteAll(); err != nil { | ||
return err | ||
} | ||
dbHandle.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. Can be deferred after getting the handle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbHandle.Close()
removes dbHandle from provider's dbHandles map, so it is only called after DeleteAll
is successful.
Got intermittent failure and opened FAB-18030. 2020-06-26T12:40:02.0392904Z Waiting for: 2020-06-26T12:40:02.0393318Z Removing member: Endpoint: 127.0.0.1:21514�[0m 2020-06-26T12:40:02.0393516Z 2020-06-26T12:40:02.0393800Z /home/vsts/work/1/go/src/github.com/hyperledger/fabric/integration/gossip/gossip_test.go:343 |
…1423) Add a Remove function to block store provider to remove block index and blocks directory for a channel. It will be called by the orderer and peer as part of channel deletion. Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
Signed-off-by: Wenjian Qiao wenjianq@gmail.com
Type of change
Description
Add a Remove function to block store provider to remove block index
and blocks directory for a channel. It will be called by the orderer
and peer as part of channel deletion.
Additional details
This PR adds the remove function to remove the block indexes and blocks dir for the channel. It is expected that the higher level above block store to handle failure recovery.
The PR is based on the current
BlockStoreProvider
design.The opened
BlockStore
for the removed channel should not be used any more because it will return invalid data. If needed, we will close the blockstore and make it unusable in a separate PR.Related issues
Story: https://jira.hyperledger.org/browse/FAB-17992
Epic: https://jira.hyperledger.org/browse/FAB-17712