-
Notifications
You must be signed in to change notification settings - Fork 154
chore: Implement data migration for lookup_application_with_origin_map
#3337
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
Conversation
src/internet_identity/src/migrations/lookup_application_with_origin.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few questions before approving to better understand the changes.
src/internet_identity/src/migrations/lookup_application_with_origin.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Thanks!
Motivation
This PR continues the work towards migrating the
lookup_application_with_origin
map's keys from 8-byte prefixes of a full sha-256 sum.< Previous PR |
Changes
post_upgrade
.Tests
Integration
upgrade_and_rollback_with_realistic_data_migration
- Upgrading the II canister succeeds, migrating 2,000 application-specific user accounts. This test passed locally in 319.35s; if that's not acceptable for the CI, we can reduce the number of accounts in this test to 10, and re-run it locally to gain confidence in the migration.Unit
should_skip_migration_if_new_map_not_empty
- When the new map already contains entries, the migration leaves both maps unchanged.should_migrate_single_entry_successfully
- Tests successful migration of one application from old hash map to new SHA-256 map, verifying correct return values and final state.should_migrate_multiple_entries_successfully
- Tests successful migration of multiple applications, ensuring all entries are properly transferred with correct mappings.should_handle_missing_application_gracefully
- Tests behavior when old map references non-existent applications, verifying missing apps are reported in return values and skipped during migration.should_handle_empty_old_map
- Tests migration behavior with empty maps, ensuring function returns empty collections and maps remain empty.should_handle_hash_collisions_correctly
- Tests collision detection where multiple applications exist in stable storage but only one is in the old map due to hash collision, verifying collision recovery mechanism.