remove unnecessary nAgreed value in partial() func (#15242)

This commit is contained in:
Harshavardhana 2022-07-07 13:45:34 -07:00 committed by GitHub
parent 5802df4365
commit ae92521310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 14 deletions

View File

@ -734,11 +734,7 @@ func (f *folderScanner) scanFolder(ctx context.Context, folder cachedFolder, int
} }
}, },
// Some disks have data for this. // Some disks have data for this.
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, errs []error) {
if f.dataUsageScannerDebug {
console.Debugf(healObjectsPrefix+" got partial, %d agreed, errs: %v\n", nAgreed, errs)
}
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if !ok { if !ok {
// check if we can get one entry atleast // check if we can get one entry atleast

View File

@ -804,7 +804,7 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
wg.Add(1) wg.Add(1)
go decommissionEntry(entry) go decommissionEntry(entry)
}, },
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, _ []error) {
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if ok { if ok {
parallelWorkers <- struct{}{} parallelWorkers <- struct{}{}

View File

@ -1822,7 +1822,7 @@ func (z *erasureServerPools) Walk(ctx context.Context, bucket, prefix string, re
minDisks: 1, minDisks: 1,
reportNotFound: false, reportNotFound: false,
agreed: loadEntry, agreed: loadEntry,
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, _ []error) {
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if !ok { if !ok {
// check if we can get one entry atleast // check if we can get one entry atleast
@ -1889,7 +1889,7 @@ func listAndHeal(ctx context.Context, bucket, prefix string, set *erasureObjects
cancel() cancel()
} }
}, },
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, _ []error) {
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if !ok { if !ok {
// check if we can get one entry atleast // check if we can get one entry atleast

View File

@ -2984,7 +2984,7 @@ func (es *erasureSingle) Walk(ctx context.Context, bucket, prefix string, result
minDisks: 1, minDisks: 1,
reportNotFound: false, reportNotFound: false,
agreed: loadEntry, agreed: loadEntry,
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, _ []error) {
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if !ok { if !ok {
// check if we can get one entry atleast // check if we can get one entry atleast

View File

@ -316,7 +316,7 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
minDisks: 1, minDisks: 1,
reportNotFound: false, reportNotFound: false,
agreed: healEntry, agreed: healEntry,
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, _ []error) {
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if !ok { if !ok {
// check if we can get one entry atleast // check if we can get one entry atleast

View File

@ -760,7 +760,7 @@ func (es *erasureSingle) listPathInner(ctx context.Context, o listPathOptions, r
case results <- entry: case results <- entry:
} }
}, },
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, errs []error) {
// Results Disagree :-( // Results Disagree :-(
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if ok { if ok {
@ -829,7 +829,7 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions, resul
case results <- entry: case results <- entry:
} }
}, },
partial: func(entries metaCacheEntries, nAgreed int, errs []error) { partial: func(entries metaCacheEntries, errs []error) {
// Results Disagree :-( // Results Disagree :-(
entry, ok := entries.resolve(&resolver) entry, ok := entries.resolve(&resolver)
if ok { if ok {
@ -1145,7 +1145,7 @@ type listPathRawOptions struct {
// partial will be called when there is disagreement between disks. // partial will be called when there is disagreement between disks.
// if disk did not return any result, but also haven't errored // if disk did not return any result, but also haven't errored
// the entry will be empty and errs will // the entry will be empty and errs will
partial func(entries metaCacheEntries, nAgreed int, errs []error) partial func(entries metaCacheEntries, errs []error)
// finished will be called when all streams have finished and // finished will be called when all streams have finished and
// more than one disk returned an error. // more than one disk returned an error.
@ -1362,7 +1362,7 @@ func listPathRaw(ctx context.Context, opts listPathRawOptions) (err error) {
continue continue
} }
if opts.partial != nil { if opts.partial != nil {
opts.partial(topEntries, agree, errs) opts.partial(topEntries, errs)
} }
// Skip the inputs we used. // Skip the inputs we used.
for i, r := range readers { for i, r := range readers {