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(iroh-sync): prevent panic in namespace migration #1775

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

Frando
Copy link
Member

@Frando Frando commented Nov 7, 2023

Description

The migration as commited with #1770 panics when starting iroh with an existing data dir. The reason is that redb panics when deleting table in a transaction where they were opened as well. See: cberner/redb#715

This fixes this by moving the table deletion to a separate transaction.

The limitation and potential panic in redb was fixed in cberner/redb#716 so once we upgrade to the next (still unreleased) version of redb, this can be removed again.

Change checklist

  • Self-review.
  • Documentation updates if relevant.

@Frando Frando changed the base branch from main to feat-query2 November 7, 2023 11:21
@Frando Frando changed the base branch from feat-query2 to main November 7, 2023 16:41
Ok(MigrateOutcome::Execute(entries))
}

/// Delete the v1 namespaces table.
fn migration_003_namespaces_delete_v1(tx: &WriteTransaction) -> Result<MigrateOutcome> {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment why this is its own migration? this is quite surprising

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 added a commit with a comment

Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

lgtm, modulu my one comment

@Frando Frando changed the title fix(iroh-sync): fix the broken namespaces table migration fix(iroh-sync): prevent panic in namespace migration Nov 7, 2023
@Frando Frando enabled auto-merge November 7, 2023 22:48
@Frando Frando added this pull request to the merge queue Nov 7, 2023
Merged via the queue into main with commit 84ae95a Nov 7, 2023
15 checks passed
@dignifiedquire dignifiedquire deleted the fix-migration-namespaces branch November 8, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants