Fix distributed listing not able to resume (#17855)

Two fields in lifecycles made GOB encoding consistently fail with `gob: type lifecycle.Prefix has no exported fields`.

This meant that in distributed systems listings would never be able to continue and would restart on every call.

Fix issues and be sure to log these errors at least once per bucket. We may see some connectivity errors here, but we shouldn't hide them.
This commit is contained in:
Klaus Post 2023-08-15 07:45:25 -07:00 committed by GitHub
parent 64aa7feabd
commit 406ea4f281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -129,7 +129,8 @@ func (z *erasureServerPools) listPath(ctx context.Context, o *listPathOptions) (
return entries, io.EOF
}
if !errors.Is(err, context.DeadlineExceeded) {
o.debugln("listPath: got error", err)
// Report error once per bucket, but continue listing.
logger.LogOnceIf(ctx, err, "GetMetacacheListing:"+o.Bucket)
}
o.Transient = true
o.Create = false

View File

@ -105,8 +105,9 @@ type ExpireDeleteMarker struct {
// Boolean signifies a boolean XML struct with custom marshaling
type Boolean struct {
val bool
set bool
val bool
set bool
Unused struct{} // Needed for GOB compatibility
}
// Expiration - expiration actions for a rule in lifecycle configuration.

View File

@ -24,7 +24,8 @@ import (
// Prefix holds the prefix xml tag in <Rule> and <Filter>
type Prefix struct {
string
set bool
set bool
Unused struct{} // Needed for GOB compatibility
}
// UnmarshalXML - decodes XML data.