From 9e87b78e1c3fbb4dd2cdcc0095681bc584f3321d Mon Sep 17 00:00:00 2001 From: JOOHOJANG Date: Tue, 5 Nov 2024 11:42:35 +0900 Subject: [PATCH] Fix version vector validation when running migration --- migrations/v0.5.3/add-version-vector.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/migrations/v0.5.3/add-version-vector.go b/migrations/v0.5.3/add-version-vector.go index 981c06693..b27953160 100644 --- a/migrations/v0.5.3/add-version-vector.go +++ b/migrations/v0.5.3/add-version-vector.go @@ -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") }