Skip to content

Conversation

@hinto-janai
Copy link
Contributor

What

Adds RuntimeError::ResizedByAnotherProcess and related handling code to storage/ crates.

Why

If another process resizes the database file, the storage code will currently panic.

Discussed here: monero-project/meta#1212.

@github-actions github-actions bot added the A-storage Area: Related to storage. label Jun 3, 2025
@github-actions github-actions bot added the A-consensus Area: Related to consensus. label Jun 3, 2025
@github-actions github-actions bot removed the A-consensus Area: Related to consensus. label Jun 4, 2025
@hinto-janai hinto-janai added C-fix Category: PRs that fixes code, or issues documenting a fix. I-crash Importance: Cuprate crashes (SIGSEGV, SIGABRT, etc). Use I-ice instead for panics. labels Jun 5, 2025
@hinto-janai hinto-janai marked this pull request as ready for review June 16, 2025 01:13
@hinto-janai hinto-janai requested a review from Boog900 June 16, 2025 01:13
Comment on lines 138 to 143
if ConcreteEnv::MANUAL_RESIZE
&& matches!(
response,
Err(RuntimeError::ResizeNeeded | RuntimeError::ResizedByAnotherProcess)
)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should still be a panic for the write interface - no other process should write to cuprated's database.

The read tower interface should handle this though IMO, currently it just returns an error.

@hinto-janai hinto-janai requested a review from Boog900 August 14, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-storage Area: Related to storage. C-fix Category: PRs that fixes code, or issues documenting a fix. I-crash Importance: Cuprate crashes (SIGSEGV, SIGABRT, etc). Use I-ice instead for panics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants