-
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: remove stores from renamed/deleted store upgrades #9409
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9409 +/- ##
===========================================
+ Coverage 35.48% 60.44% +24.96%
===========================================
Files 332 590 +258
Lines 32620 37253 +4633
===========================================
+ Hits 11575 22518 +10943
+ Misses 19819 12754 -7065
- Partials 1226 1981 +755
|
@robert-zaremba @aaronc can you of you have a look at this and give an ack if all looks good? |
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.
utACK.
For upgrades, would we want to keep renamed stores around and route to the old module if state is still present on the node for it?
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.
I'm missing a context here.
- What problem are we solving? Fix upgrate store loader #7991 doesn't provide a clear context either.
- Why do we need to remember deleted stores?
- What should happen if someone wants to save a data to a deleted store? I suggest we should fail (return error). We are missing a test for that.
- What should happen when we restart an app?
- Documentation is missing.
|
||
rs.lastCommitInfo = commitStores(version, rs.stores) | ||
// remove remnants of removed stores | ||
for sk := range rs.removalMap { |
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.
for sk := range rs.removalMap { | |
for key := range rs.removalMap { |
re: @robert-zaremba
Renamed stores were not being removed from storage. Since the original store from a rename was never added to the newStore map, once a commit happened - the commit store would just assume no changes were made to that store, so it would leave it as is.
The stores that need to be deleted are only held temporarily in the
Wouldn't you first have to acquire the key? I believe we already have errors to handle that situation, but i can look into fleshing out a more direct test for this situation though
not sure - do you see any issues that could arise from this?
i can add some lines to cosmos-sdk/store readme |
re: @marbar3778
hmm could you explain this situation more? i'd assumed a rename with new module would be more of a hard fork situation |
oh, I was thinking in the case of rolling upgrades. In the case of a hard fork I don't think this would matter cause migration scripts would handle it. |
ahh okay gotcha. are there situations where devs would inject |
iirc on renaming a store, all the data is moved/copied over to the new store. |
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.
utACK
Description
CommitInfo
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes