From 10d2ef54499c430c8a1e1609369f26bcce845276 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Tue, 27 Sep 2016 18:28:46 -0700 Subject: [PATCH] Remove comments relating to deprecated MINIO_DEBUG envvar (#2797) --- cmd/fs-v1-multipart.go | 27 +++++++++------------------ cmd/xl-v1-bucket.go | 9 +++------ cmd/xl-v1-list-objects-heal.go | 3 +-- cmd/xl-v1-multipart.go | 33 +++++++++++---------------------- cmd/xl-v1-object.go | 15 +++++---------- cmd/xl-v1.go | 3 +-- 6 files changed, 30 insertions(+), 60 deletions(-) diff --git a/cmd/fs-v1-multipart.go b/cmd/fs-v1-multipart.go index 607cdebec..a51085e53 100644 --- a/cmd/fs-v1-multipart.go +++ b/cmd/fs-v1-multipart.go @@ -58,8 +58,7 @@ func (fs fsObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark var err error var eof bool if uploadIDMarker != "" { - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, keyMarker), opsID) uploads, _, err = listMultipartUploadIDs(bucket, keyMarker, uploadIDMarker, maxUploads, fs.storage) @@ -114,8 +113,7 @@ func (fs fsObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark var end bool uploadIDMarker = "" - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, entry), opsID) @@ -233,8 +231,7 @@ func (fs fsObjects) newMultipartUpload(bucket string, object string, meta map[st fsMeta.Meta = meta } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // This lock needs to be held for any changes to the directory contents of ".minio.sys/multipart/object/" @@ -410,8 +407,7 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s uploadIDPath := path.Join(mpartMetaPrefix, bucket, object, uploadID) - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(minioMetaBucket, uploadIDPath, opsID) @@ -476,8 +472,7 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s } } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID = getOpsID() // Hold write lock as we are updating fs.json @@ -583,8 +578,7 @@ func (fs fsObjects) ListObjectParts(bucket, object, uploadID string, partNumberM return ListPartsInfo{}, traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that there is no competing abort-multipart-upload or complete-multipart-upload. @@ -620,8 +614,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload } uploadIDPath := path.Join(mpartMetaPrefix, bucket, object, uploadID) - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that @@ -748,8 +741,7 @@ func (fs fsObjects) CompleteMultipartUpload(bucket string, object string, upload return "", toObjectErr(err, bucket, object) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID = getOpsID() // Hold the lock so that two parallel complete-multipart-uploads do not @@ -844,8 +836,7 @@ func (fs fsObjects) AbortMultipartUpload(bucket, object, uploadID string) error return traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that there is no competing complete-multipart-upload or put-object-part. diff --git a/cmd/xl-v1-bucket.go b/cmd/xl-v1-bucket.go index e3f767ec7..45cb33851 100644 --- a/cmd/xl-v1-bucket.go +++ b/cmd/xl-v1-bucket.go @@ -31,8 +31,7 @@ func (xl xlObjects) MakeBucket(bucket string) error { return traceError(BucketNameInvalid{Bucket: bucket}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.Lock(bucket, "", opsID) @@ -175,8 +174,7 @@ func (xl xlObjects) GetBucketInfo(bucket string) (BucketInfo, error) { if !IsValidBucketName(bucket) { return BucketInfo{}, BucketNameInvalid{Bucket: bucket} } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(bucket, "", opsID) @@ -251,8 +249,7 @@ func (xl xlObjects) DeleteBucket(bucket string) error { return BucketNameInvalid{Bucket: bucket} } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.Lock(bucket, "", opsID) diff --git a/cmd/xl-v1-list-objects-heal.go b/cmd/xl-v1-list-objects-heal.go index 1039faf8f..a273e7920 100644 --- a/cmd/xl-v1-list-objects-heal.go +++ b/cmd/xl-v1-list-objects-heal.go @@ -138,8 +138,7 @@ func (xl xlObjects) listObjectsHeal(bucket, prefix, marker, delimiter string, ma continue } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Check if the current object needs healing diff --git a/cmd/xl-v1-multipart.go b/cmd/xl-v1-multipart.go index ce648a6f4..72cc27cb5 100644 --- a/cmd/xl-v1-multipart.go +++ b/cmd/xl-v1-multipart.go @@ -62,8 +62,7 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark // List all upload ids for the keyMarker starting from // uploadIDMarker first. if uploadIDMarker != "" { - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, keyMarker), opsID) @@ -132,8 +131,7 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark var end bool uploadIDMarker = "" - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // For the new object entry we get all its pending uploadIDs. @@ -278,8 +276,7 @@ func (xl xlObjects) newMultipartUpload(bucket string, object string, meta map[st xlMeta.Stat.ModTime = time.Now().UTC() xlMeta.Meta = meta - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // This lock needs to be held for any changes to the directory contents of ".minio.sys/multipart/object/" @@ -353,8 +350,7 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s var errs []error uploadIDPath := pathJoin(mpartMetaPrefix, bucket, object, uploadID) - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(minioMetaBucket, uploadIDPath, opsID) @@ -439,8 +435,7 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s } } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID = getOpsID() nsMutex.Lock(minioMetaBucket, uploadIDPath, opsID) @@ -588,8 +583,7 @@ func (xl xlObjects) ListObjectParts(bucket, object, uploadID string, partNumberM return ListPartsInfo{}, traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that there is no competing abort-multipart-upload or complete-multipart-upload. @@ -625,8 +619,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload }) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that @@ -745,8 +738,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload return "", toObjectErr(rErr, minioMetaBucket, uploadIDPath) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID = getOpsID() // Hold write lock on the destination before rename. @@ -798,8 +790,7 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload // Delete the previously successfully renamed object. xl.deleteObject(minioMetaBucket, path.Join(tmpMetaPrefix, uniqueID)) - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID = getOpsID() // Hold the lock so that two parallel complete-multipart-uploads do not @@ -845,8 +836,7 @@ func (xl xlObjects) abortMultipartUpload(bucket, object, uploadID string) (err e return toObjectErr(err, bucket, object) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.Lock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, object), opsID) @@ -902,8 +892,7 @@ func (xl xlObjects) AbortMultipartUpload(bucket, object, uploadID string) error return traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Hold lock so that there is no competing complete-multipart-upload or put-object-part. diff --git a/cmd/xl-v1-object.go b/cmd/xl-v1-object.go index 96187a9bb..b3ad00981 100644 --- a/cmd/xl-v1-object.go +++ b/cmd/xl-v1-object.go @@ -57,8 +57,7 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i return traceError(errUnexpected) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Lock the object before reading. @@ -231,8 +230,7 @@ func (xl xlObjects) HealObject(bucket, object string) error { return traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Lock the object before healing. @@ -360,8 +358,7 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) { return ObjectInfo{}, ObjectNameInvalid{Bucket: bucket, Object: object} } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.RLock(bucket, object, opsID) @@ -624,8 +621,7 @@ func (xl xlObjects) PutObject(bucket string, object string, size int64, data io. } } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() // Lock the object. @@ -754,8 +750,7 @@ func (xl xlObjects) DeleteObject(bucket, object string) (err error) { return traceError(ObjectNameInvalid{Bucket: bucket, Object: object}) } - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.Lock(bucket, object, opsID) diff --git a/cmd/xl-v1.go b/cmd/xl-v1.go index c217a8913..2472f6a16 100644 --- a/cmd/xl-v1.go +++ b/cmd/xl-v1.go @@ -187,8 +187,7 @@ func (xl xlObjects) Shutdown() error { // HealDiskMetadata function for object storage interface. func (xl xlObjects) HealDiskMetadata() error { - // generates random string on setting MINIO_DEBUG=lock, else returns empty string. - // used for instrumentation on locks. + // get a random ID for lock instrumentation. opsID := getOpsID() nsMutex.Lock(minioMetaBucket, formatConfigFile, opsID)