...
When the LevelDB database becomes corrupted, the RepairDB option provided by the LevelDB API can be used to recover as much as data as possible. In LevelDB, the manifest file holds account of all files and their corresponding key ranges. The recovery process inspects each file in the leveldb directory and updates the manifest accordingly. This implies that any missing files would lead to loss of data, which in turn can prevent a successful restoration of the repository.
The below script can be used to repair corrupt leveldb cache:
...