Skip to content

Add file rotation#4

Merged
cmfriend merged 3 commits into
mainfrom
add_file_rotation
May 9, 2026
Merged

Add file rotation#4
cmfriend merged 3 commits into
mainfrom
add_file_rotation

Conversation

@cmfriend
Copy link
Copy Markdown
Owner

@cmfriend cmfriend commented May 4, 2026

Also:

  • Name files with unix epoch milliseconds timestamps only
  • Rename RUSTCASK_MAX_FILE_SIZE to RUSTCASK_ROTATE_ACTIVE_FILE_AFTER_BYTES to better indicate what it does
  • Add root path and Map of readers to rotated files to RustcaskDatabase struct
  • Return Vec of deleted keys from rebuild_keydir to correctly build database on startup from multiple files

Also:
- Name files with unix epoch seconds timestamps only
- Rename RUSTCASK_MAX_FILE_SIZE to RUSTCASK_ROTATE_ACTIVE_FILE_AFTER_BYTES to better indicate what it does
- Add root path and Map of readers to rotated files to RustcaskDatabase struct
- Return Vec of deleted keys from rebuild_keydir to correctly build database on startup from multiple files
Comment thread src/main.rs Outdated
Comment thread src/rustcask_database.rs Outdated
Comment thread src/rustcask_database.rs Outdated
Comment thread src/rustcask_database.rs
- Use more idiomatic method to parse env variable for active file bytes
  rotation threshold
- Switch to using milliseconds since unix epoch for log file names
- Remove unneeded flag settings for false values for OpenOptions
- Handle error case when generating the next file id is the same as the
  currently active file id
Comment thread src/rustcask_database.rs Outdated
@cmfriend cmfriend merged commit 274374e into main May 9, 2026
@cmfriend cmfriend deleted the add_file_rotation branch May 9, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants