Skip to content

Commit

Permalink
Fix version vector validation when running migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JOOHOJANG committed Nov 5, 2024
1 parent 5aaacfb commit 9e87b78
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions migrations/v0.5.3/add-version-vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@ func validateAddVersionVector(ctx context.Context, db *mongo.Client, databaseNam
}

versionVector := info.VersionVector
actors, err := versionVector.Keys()
actorID, err := info.ActorID.ToActorID()
if err != nil {
return err
}

if len(actors) > 1 {
return fmt.Errorf("found %d actor in version vector", len(actors))
}

if versionVector.VersionOf(actors[0]) != info.Lamport {
if versionVector.VersionOf(actorID) != info.Lamport {
return fmt.Errorf("wrong lamport in version vector")
}

Expand Down

0 comments on commit 9e87b78

Please sign in to comment.