Skip to content

Commit

Permalink
multi-objects prefix iterator: exclude directories (fix)
Browse files Browse the repository at this point in the history
* list-range iterator: when listing remote buckets
  (which we do given prefix) ask remote backend _not_ to include directories

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Nov 8, 2024
1 parent 16280ab commit 73b4db2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xact/xs/lrit.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@ func (r *lrit) _prefix(wi lrwi, smap *meta.Smap) error {
err error
ecode int
lst *cmn.LsoRes
msg = &apc.LsoMsg{Prefix: r.prefix, Props: apc.GetPropsStatus}
npg = newNpgCtx(r.bck, msg, noopCb, nil /*core.LsoInvCtx bucket inventory*/)
lsmsg = &apc.LsoMsg{Prefix: r.prefix, Props: apc.GetPropsStatus}
npg = newNpgCtx(r.bck, lsmsg, noopCb, nil /*core.LsoInvCtx bucket inventory*/)
bremote = r.bck.IsRemote()
)
lsmsg.SetFlag(apc.LsNoDirs)

if err := r.bck.Init(core.T.Bowner()); err != nil {
return err
}
Expand All @@ -276,7 +278,7 @@ func (r *lrit) _prefix(wi lrwi, smap *meta.Smap) error {
}
if bremote {
lst = &cmn.LsoRes{Entries: allocLsoEntries()}
ecode, err = core.T.Backend(r.bck).ListObjects(r.bck, msg, lst) // (TODO comment above)
ecode, err = core.T.Backend(r.bck).ListObjects(r.bck, lsmsg, lst) // (TODO comment above)
} else {
npg.page.Entries = allocLsoEntries()
err = npg.nextPageA()
Expand Down Expand Up @@ -315,7 +317,7 @@ func (r *lrit) _prefix(wi lrwi, smap *meta.Smap) error {
break
}
// token for the next page
msg.ContinuationToken = lst.ContinuationToken
lsmsg.ContinuationToken = lst.ContinuationToken
}
return nil
}
Expand Down

0 comments on commit 73b4db2

Please sign in to comment.