From 6909c0522d05574a5ca3d94caa47590e293900b1 Mon Sep 17 00:00:00 2001 From: Gregory Newman-Smith Date: Tue, 24 Sep 2024 21:48:57 +0100 Subject: [PATCH] updates to not process docs with no attachments to migrate --- db/background_mgr_attachment_migration.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/db/background_mgr_attachment_migration.go b/db/background_mgr_attachment_migration.go index e0c59b68e0..1568ca5d24 100644 --- a/db/background_mgr_attachment_migration.go +++ b/db/background_mgr_attachment_migration.go @@ -120,17 +120,17 @@ func (a *AttachmentMigrationManager) Run(ctx context.Context, options map[string return true } + if syncData == nil || syncData.Attachments == nil { + // no attachments to migrate + return true + } + collCtx := collection.AddCollectionContext(ctx) collWithUser := &DatabaseCollectionWithUser{ DatabaseCollection: collection, } if event.DataType&base.MemcachedDataTypeXattr == 0 { - // no xattrs on dcp event, check for sync data - if syncData == nil { - // no inline sync xattr, skip event - return true - } - // we have inline sync xattr to migrate + // no xattrs on dcp event we have inline sync xattr to migrate opts := DefaultMutateInOpts() existingDoc := &sgbucket.BucketDocument{ Cas: event.Cas,