Skip to content
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] Resolve issue with corruption marking on empty index #3235

Open
wants to merge 1 commit into
base: release/3.25.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 3.25.1
- Fix corruption marking on empty index db (mihran113)

## 3.25.0 Oct 2, 2024

### Enhancements:
Expand Down
13 changes: 8 additions & 5 deletions aim/storage/union.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,14 @@ class DB(object):
# delete index db and mark as corrupted
corruption_marker = Path(index_path) / '.corrupted'
if not corruption_marker.exists():
logger.warning('Corrupted index db. Deleting the index db to avoid errors. '
'Please run `aim storage reindex command to restore optimal performance.`')
shutil.rmtree(index_path)
Path(index_path).mkdir()
corruption_marker.touch()
# discard the case when index db does not exist
rocks_current_path = Path(index_path) / 'CURRENT'
if rocks_current_path.exists():
logger.warning('Corrupted index db. Deleting the index db to avoid errors. '
'Please run `aim storage reindex command to restore optimal performance.`')
shutil.rmtree(index_path)
Path(index_path).mkdir()
corruption_marker.touch()
index_db = None
except Exception:
index_db = None
Expand Down
Loading