mirror of
https://github.com/minio/minio.git
synced 2025-01-12 15:33:22 -05:00
Add version id to healresult (#16193)
This commit is contained in:
parent
8edc2faaa9
commit
70986b6e6e
@ -94,7 +94,7 @@ func (er erasureObjects) healBucket(ctx context.Context, storageDisks []StorageA
|
|||||||
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
defer func() {
|
defer func() {
|
||||||
healTrace(healingMetricBucket, startTime, bucket, "", "", &opts, err, &res)
|
healTrace(healingMetricBucket, startTime, bucket, "", &opts, err, &res)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ func (er *erasureObjects) healObject(ctx context.Context, bucket string, object
|
|||||||
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
defer func() {
|
defer func() {
|
||||||
healTrace(healingMetricObject, startTime, bucket, object, versionID, &opts, err, &result)
|
healTrace(healingMetricObject, startTime, bucket, object, &opts, err, &result)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
// Initialize heal result object
|
// Initialize heal result object
|
||||||
@ -313,6 +313,7 @@ func (er *erasureObjects) healObject(ctx context.Context, bucket string, object
|
|||||||
Type: madmin.HealItemObject,
|
Type: madmin.HealItemObject,
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
Object: object,
|
Object: object,
|
||||||
|
VersionID: versionID,
|
||||||
DiskCount: len(storageDisks),
|
DiskCount: len(storageDisks),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -684,7 +685,7 @@ func (er *erasureObjects) checkAbandonedParts(ctx context.Context, bucket string
|
|||||||
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
if globalTrace.NumSubscribers(madmin.TraceHealing) > 0 {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
defer func() {
|
defer func() {
|
||||||
healTrace(healingMetricCheckAbandonedParts, startTime, bucket, object, "", nil, err, nil)
|
healTrace(healingMetricCheckAbandonedParts, startTime, bucket, object, nil, err, nil)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
if !opts.NoLock {
|
if !opts.NoLock {
|
||||||
@ -1042,7 +1043,7 @@ func (er erasureObjects) HealObject(ctx context.Context, bucket, object, version
|
|||||||
}
|
}
|
||||||
|
|
||||||
// healTrace sends healing results to trace output.
|
// healTrace sends healing results to trace output.
|
||||||
func healTrace(funcName healingMetric, startTime time.Time, bucket, object, versionID string, opts *madmin.HealOpts, err error, result *madmin.HealResultItem) {
|
func healTrace(funcName healingMetric, startTime time.Time, bucket, object string, opts *madmin.HealOpts, err error, result *madmin.HealResultItem) {
|
||||||
tr := madmin.TraceInfo{
|
tr := madmin.TraceInfo{
|
||||||
TraceType: madmin.TraceHealing,
|
TraceType: madmin.TraceHealing,
|
||||||
Time: startTime,
|
Time: startTime,
|
||||||
@ -1054,9 +1055,6 @@ func healTrace(funcName healingMetric, startTime time.Time, bucket, object, vers
|
|||||||
if opts != nil {
|
if opts != nil {
|
||||||
tr.Message = fmt.Sprintf("dry:%v, rm:%v, recreate:%v mode:%v", opts.DryRun, opts.Remove, opts.Recreate, opts.ScanMode)
|
tr.Message = fmt.Sprintf("dry:%v, rm:%v, recreate:%v mode:%v", opts.DryRun, opts.Remove, opts.Recreate, opts.ScanMode)
|
||||||
}
|
}
|
||||||
if versionID != "" && versionID != "null" {
|
|
||||||
tr.Path += " v=" + versionID
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tr.Error = err.Error()
|
tr.Error = err.Error()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user