{{ message }}
fix(ha/auth): Migrate users during rolling upgrade between Memgraph instances of different versions#4301
Open
colinbarry wants to merge 39 commits into
Open
fix(ha/auth): Migrate users during rolling upgrade between Memgraph instances of different versions#4301colinbarry wants to merge 39 commits into
colinbarry wants to merge 39 commits into
Conversation
Contributor
Author
5d20789 to
316734c
Compare
556927c to
df60fa6
Compare
3ee6c93 to
e7a6dc1
Compare
which were missing new "version" field in user/role structs
94838ef to
37708d3
Compare
37708d3 to
1e2a3ec
Compare
mattkjames7
reviewed
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




User/role data sent over the wire was not being migrated.
During a rolling upgrade from
3.9to3.10.1, LBAC grants are lost when a3.9MAIN replicates auth data to an upgraded3.10.1REPLICA. The old MAIN serializes user/role structs inV3format, but the REPLICA'sDeserializeexpectsV4; the result is that FGA fields are silently dropped. When failover occurs and REPLICA becomes MAIN, it does so with sheared user configurations.UpdateAuthDataReq/Resusing the existingLoadWithUpgrade/SaveWithDowngradeframework. The existing wire format is now V1 (kVersion=1); upgraded nodes send V2. When a new REPLICA receives a V1 request from an old MAIN, it reads the raw JSON, migrates it viaMigrateAuthJson, then deserializes. V2 Load also appliesMigrateAuthJsonon reception, ensuring forward compatibility with future entity versions without needing RPC version bumps in parallel to user version bumps.V2->V3andV3->V4migration logic intoMigrateAuthJson(). Each user or role now carries a"version"field.V1->V2->V5) are now reserved for structural KV store changes such as key prefix migrations. Entity schema changes (such as fine-grained access) are handled per-entity on deserialize.verify_fga_post_upgrade.shto confirm FGA grants survive mid-upgrade (on REPLICA while old MAIN is still running) and post-upgrade. ISSU test need further enhancement, but that will come in successive PRs.