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

Problem: memiavl restore fail to reopen the db #1130

Merged
merged 5 commits into from
Aug 10, 2023

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Aug 9, 2023

Solution:

  • grab the file lock before restoration starts, to prevent multiple concurrent restorations.
  • close the db before doing the restoration.
  • reproduce the issue in integration test.

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Solution:
- close the db before open again
@yihuang yihuang requested a review from a team as a code owner August 9, 2023 15:43
@yihuang yihuang requested review from devashishdxt and leejw51crypto and removed request for a team August 9, 2023 15:43
@yihuang yihuang marked this pull request as draft August 9, 2023 15:43
@yihuang yihuang marked this pull request as ready for review August 9, 2023 15:52
@yihuang yihuang changed the title Problem: memiavl restore fail to reopen twice Problem: memiavl restore fail to reopen the db Aug 9, 2023
@yihuang yihuang requested a review from mmsqe August 9, 2023 16:15
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1130 (78366c6) into main (ee517d8) will increase coverage by 23.22%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1130       +/-   ##
===========================================
+ Coverage   22.92%   46.14%   +23.22%     
===========================================
  Files          47       82       +35     
  Lines        3089     7461     +4372     
===========================================
+ Hits          708     3443     +2735     
- Misses       2311     3652     +1341     
- Partials       70      366      +296     
Files Changed Coverage Δ
memiavl/import.go 64.64% <66.66%> (ø)

... and 49 files with indirect coverage changes

memiavl/import.go Outdated Show resolved Hide resolved
@yihuang yihuang requested a review from mmsqe August 10, 2023 03:01
@mmsqe mmsqe enabled auto-merge August 10, 2023 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants