-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Fix upgrate store loader #7991
Fix upgrate store loader #7991
Conversation
@@ -146,8 +146,11 @@ func TestSetLoader(t *testing.T) { | |||
require.NotNil(t, res.Data) | |||
|
|||
// check db is properly updated | |||
if tc.setLoader != nil { | |||
checkStore(t, db, upgradeHeight, tc.origStoreKey, k, nil) |
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.
if the deleted store is not added in the method loadVersion(), the tc.origStoreKey will still have data ,and v will never be nil
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.
looks reasonable to me, but I do not have too much context here. I do recall @ethanfrey implementing this logic so it'd be good to get a review/ACK from him too.
Codecov Report
@@ Coverage Diff @@
## master #7991 +/- ##
==========================================
+ Coverage 61.61% 62.93% +1.32%
==========================================
Files 606 687 +81
Lines 34791 45152 +10361
==========================================
+ Hits 21435 28416 +6981
- Misses 11129 13892 +2763
- Partials 2227 2844 +617
|
gentle ping for @ethanfrey, I tried to review this PR, but also don't feel super familiar with the code. |
2e54825
to
ecc5f47
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I missed this til now. It seems reasonable. I assumed this was committed but too far from the sdk to say for sure now. It would be good to have a better insight. This is only for store renames, do we need to do something different for The test that would convince me the most would be to attach a TraceStore to the database, perform this rename (in tests) and check the output of the trace store. Same with deleting a store. To show what operations are actually committed in these simple cases. Also to print out the multistore |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think this shouldn't have been closed. I will try to take a look soon. |
delete store actually deletes, as its key is put into the
I'm not sure this is possible without editing the I was able to get rid of the removed stores from CommitInfo by adding a new field to the root store, I've created a draft PR implementing this fix |
shall we close this PR? It seams #9409 superseeds this PR |
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> - stores that were renamed are now properly deleted - deleted/renamed and renamed stores are no longer added to `CommitInfo` - deleted/renamed stores are now properly removed from rootmulti store's memory ref: #7991 closes: N/A --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [x] Review `Codecov Report` in the comment section below once CI passes
Description
Add the deleted store, or the delete operation will not be committed, and the data in old store will not be properly deleted.