I am using stable-structures’s btreemap to store my datas.
When i want to get object from the btreemap, i get an panic and said the magic number is not match, left is [66, 84, 82] and right is [66, 84 ,78]. I skim the source code and see that the BTR is the header magic of btreemap, and the BTN is the header magic of node, so i think there maybe a data corrupt happened.
This is the process I think that make this thing happened:
- I declared the max_value_size to be 1024, and insert some data.
- I change the max_value_size to 2048, but when i upgrade the canister, that is an error message say that the max_value_size can not exists 1024.
- I change the max_value_size back to 1024, upgrade the canister again. then the magic number not match problem come up.
I have try the following method to solve the problem:
- I pull the stable-structures source code, an wanna to add some debug message with ic_cdk::println!, but it fail to compile
2.I call the stable64_size(), and call stable64_read() to read the whole data from stable storage, but see nothing relative to stable-structures, i didn’t see any magic number like BTR, BTC…
So what should I do next