fix: avoid logging when object/version not found in replication (#16919)

This commit is contained in:
Allan Roger Reid 2023-03-29 15:02:45 -07:00 committed by GitHub
parent 13151cbb2b
commit 483b226cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -508,7 +508,6 @@ func replicateDelete(ctx context.Context, dobj DeletedObjectReplicationInfo, obj
VersionSuspended: globalBucketVersioningSys.Suspended(bucket), VersionSuspended: globalBucketVersioningSys.Suspended(bucket),
}) })
if err != nil && !isErrVersionNotFound(err) { // VersionNotFound would be reported by pool that object version is missing on. if err != nil && !isErrVersionNotFound(err) { // VersionNotFound would be reported by pool that object version is missing on.
logger.LogIf(ctx, fmt.Errorf("Unable to update replication metadata for %s/%s(%s): %s", bucket, dobj.ObjectName, versionID, err))
sendEvent(eventArgs{ sendEvent(eventArgs{
BucketName: bucket, BucketName: bucket,
Object: ObjectInfo{ Object: ObjectInfo{
@ -1005,10 +1004,7 @@ func replicateObject(ctx context.Context, ri ReplicateObjectInfo, objectAPI Obje
}, },
} }
if _, err = objectAPI.PutObjectMetadata(ctx, bucket, object, popts); err != nil { _, _ = objectAPI.PutObjectMetadata(ctx, bucket, object, popts);
logger.LogIf(ctx, fmt.Errorf("Unable to update replication metadata for %s/%s(%s): %w",
bucket, objInfo.Name, objInfo.VersionID, err))
}
opType := replication.MetadataReplicationType opType := replication.MetadataReplicationType
if rinfos.Action() == replicateAll { if rinfos.Action() == replicateAll {
opType = replication.ObjectReplicationType opType = replication.ObjectReplicationType