containerd / containerd/overlaybd
If the registry_cache files are corrupted overlaybd fails to load.
- Dominant language
- C++
- Stars
- 410
- Forks
- 85
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 10
Description
### What happened in your environment?
Looks like if the registry_cache has some corrupt files overlaybd fails to create image.
logs below
```
2023/07/13 07:02:37|ERROR|th=00007FE4F37F9F80|/src/src/overlaybd/lsmt/file.cpp:1159|verify_ht:header magic/type don't match
2023/07/13 07:02:37|ERROR|th=00007FE4F37F9F80|/src/src/overlaybd/lsmt/file.cpp:1553|do_parallel_load_index:failed to load index from 32-th file
2023/07/13 07:02:37|ERROR|th=00007FE5D1B53B00|/src/src/overlaybd/lsmt/file.cpp:1581|load_merge_index:load index failed.
2023/07/13 07:02:37|ERROR|th=00007FE5D1B53B00|/src/src/image_file.cpp:346|open_lowers:LSMT::open_files_ro(files, 76, 1) return NULL
2023/07/13 07:02:37|ERROR|th=00007FE5D1B53B00|/src/src/image_file.cpp:470|init_image_file:open lower layer failed.
2023/07/13 07:02:37|ERROR|th=00007FE5D1B53B00|/src/src/main.cpp:302|dev_open:create image file failed
2023/07/13 07:02:37|ERROR|th=00007FE5D1B53B00|/src/build/_deps/tcmu-src/libtcmu.cpp:605|device_add:handler open failed for uio3
```
Looks like it would be good to have logic to delete the file and retry?
### What did you expect to happen?
Recover by deleting the file and redownloading.
### How can we reproduce it?
1. Start a container on overlaybd.
2. Corrupt the registry_cache files by writing junk to it
3. observe the container doesn't start anymore.
### What is the version of your Overlaybd?
0.5.3-1.
### What is your OS environment?
Ubuntu 20.04
### Are you willing to submit PRs to fix it?
- [X] Yes, I am willing to fix it.
Contributor guide
Assessment
This issue has not been assessed yet.