Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CBR-496] Fix --rebuild-db not rebuilding sqlite #3947

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

KtorZ
Copy link
Contributor

@KtorZ KtorZ commented Dec 10, 2018

Description

Turns out we aren't actually removing the sqlite database when passing --rebuild-db becaue the SQLite db is actually stored in a file and not a directory.

Linked issue

[CBR-496]

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

How to merge

Send the message bors r+ to merge this PR. For more information, see
docs/how-to/bors.md.

The sqlite db is actually stored in a file and not a directory
@KtorZ KtorZ self-assigned this Dec 10, 2018
@KtorZ KtorZ requested a review from kderme December 10, 2018 10:50
@KtorZ
Copy link
Contributor Author

KtorZ commented Dec 10, 2018

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 10, 2018
3947: [CBR-496] Fix --rebuild-db not rebuilding sqlite r=KtorZ a=KtorZ

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

Turns out we aren't actually removing the sqlite database when passing --rebuild-db becaue the SQLite db is actually stored in a file and not a directory. 

## Linked issue

<!--- Put here the relevant issue from YouTrack -->

[[CBR-496]](https://iohk.myjetbrains.com/youtrack/issue/CO-445)



Co-authored-by: KtorZ <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 10, 2018

Timed out

@jmitchell
Copy link
Contributor

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 10, 2018
3943: [CBR-495] Fix inconsistent metadata store after deletion r=KtorZ a=KtorZ

## Description

We store some information related to transaction in the metadata store (sqlite). However, when looking up transaction with metadata referring to wallet we don't know about, we fail with a not so friendly error "WalletNotFound" despite no wallet being given as part of the query.

This fix is actually two folds:

- It discards incoherent transactions fetched from the DB, if any,
  and shout a warning in the log. This is in order to make the system
  more resilient to conconcurrent calls while a wallet or account is
  being deleted (since metadata and accounts / wallets are stored in
  separated databases, we can't easily run both delete in a single
  transaction).

- It also deletes corresponding metadata when an account or a wallet
  is removed. This may cause extra damage? What if there are pending
  transactions when we delete the account or wallet.

## Linked issue

[CBR-495](https://iohk.myjetbrains.com/youtrack/issue/CBR-495)



3947: [CBR-496] Fix --rebuild-db not rebuilding sqlite r=jmitchell a=KtorZ

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

Turns out we aren't actually removing the sqlite database when passing --rebuild-db becaue the SQLite db is actually stored in a file and not a directory. 

## Linked issue

<!--- Put here the relevant issue from YouTrack -->

[[CBR-496]](https://iohk.myjetbrains.com/youtrack/issue/CO-445)



Co-authored-by: KtorZ <[email protected]>
Co-authored-by: kderme <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 10, 2018

Timed out (retrying...)

@jmitchell
Copy link
Contributor

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 10, 2018

Not awaiting review

iohk-bors bot added a commit that referenced this pull request Dec 10, 2018
3943: [CBR-495] Fix inconsistent metadata store after deletion r=jmitchell a=KtorZ

## Description

We store some information related to transaction in the metadata store (sqlite). However, when looking up transaction with metadata referring to wallet we don't know about, we fail with a not so friendly error "WalletNotFound" despite no wallet being given as part of the query.

This fix is actually two folds:

- It discards incoherent transactions fetched from the DB, if any,
  and shout a warning in the log. This is in order to make the system
  more resilient to conconcurrent calls while a wallet or account is
  being deleted (since metadata and accounts / wallets are stored in
  separated databases, we can't easily run both delete in a single
  transaction).

- It also deletes corresponding metadata when an account or a wallet
  is removed. This may cause extra damage? What if there are pending
  transactions when we delete the account or wallet.

## Linked issue

[CBR-495](https://iohk.myjetbrains.com/youtrack/issue/CBR-495)



3947: [CBR-496] Fix --rebuild-db not rebuilding sqlite r=jmitchell a=KtorZ

## Description

<!--- A brief description of this PR and the problem is trying to solve -->

Turns out we aren't actually removing the sqlite database when passing --rebuild-db becaue the SQLite db is actually stored in a file and not a directory. 

## Linked issue

<!--- Put here the relevant issue from YouTrack -->

[[CBR-496]](https://iohk.myjetbrains.com/youtrack/issue/CO-445)



Co-authored-by: KtorZ <[email protected]>
Co-authored-by: kderme <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 11, 2018

@iohk-bors iohk-bors bot merged commit 56c179d into release/2.0.0 Dec 11, 2018
@iohk-bors iohk-bors bot deleted the KtorZ/CBR-496/fix-wallet-rebuild-db-flag branch December 11, 2018 00:23
@KtorZ KtorZ mentioned this pull request Jan 4, 2019
12 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants