-
Notifications
You must be signed in to change notification settings - Fork 116
Content no unused code #2680
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
Content no unused code #2680
Conversation
|
I think in the Sumer release we were a little over ambitious about what features in the new content directory we were going to implement. The only type that was modified and is still in use after these changes is the Two related changes must be done |
mnaamani
left a comment
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.
Only minor merge conflict needed, otherwise LGTM.
Left instructions on related changes needed. #2680 (comment)
First off, I think clearing is a linear time operation in number of mappings, so that may not work with the number of videos we have. It could also be one of those issues that work in a small staging network, but with 100 validator real network it possibly may not. Second, could a simpler fix here be to just change the name of the map in the new content directory? There is actually a good case for going away from the concept of calling stuff in channels |
Agreed. it is risky to do a time consuming operation like clearing the map entries explicitly.
Yes that would be very neat way, and we have used this approach before when updating from one version of our A more general approach, if we expect to want to clear content again in another upgrade is to add a new pointer into the map. Currently we have one pointer (to the end of the map) the One more simpler way is to just delete the first entry, and set next_video_id to 0 and just add checks the id is less than next_video_id. For both approaches the impact on disk storage is the same. We can never really recover the on disk storage usage. But in the former approach the chain state size is reduced. |
|
There is a problem actually with my suggested approach of just updating the "pointers". The entries in the map still exist, which means if runtime code does VideoById::exists() are not reliable, iteration on the map which we shouldn't do anyway are not safe, and over RPC getting all the keys or entries of a map will be inconsistent, so applications if reading state from the map would have to also be constrained to reading values in the correct range. We should look to see if there is a built in api method on the map to clear it that is |
|
In order to solve the |
I think that is acceptable. On thing we can ask also is should we in |
Would |
I have explicitly asked about this, and Shawn@Parity said he thought that was impossible in principle. Now I think that is a bit strong, but that almost certainly means it's not possible in Substrate. |
I got the same feedback. It should be okay for deleting the We will have to test on staging network. But it is still risky to assume we will get same results in production. |
Exactly, can we really do this if we dont know it wont be a disaster? Perhaps we could ask someone whether 500 database writes is plausible on standard hardware? |
I can ask. One final approach can be to rename the entire module in the runtime implementation itself from |
fc7b4f1 to
71f102d
Compare
|
Sorry for the confusion. Here's what I did:
|
71f102d to
7888796
Compare
|
Closing in favor of #3137 |
as #2677.
Query node mappings are left to @Lezek123