From 73b4db23478d02946f7904e0880ffe35d983762e Mon Sep 17 00:00:00 2001 From: Alex Aizman Date: Fri, 8 Nov 2024 13:03:37 -0500 Subject: [PATCH] multi-objects prefix iterator: exclude directories (fix) * list-range iterator: when listing remote buckets (which we do given prefix) ask remote backend _not_ to include directories Signed-off-by: Alex Aizman --- xact/xs/lrit.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xact/xs/lrit.go b/xact/xs/lrit.go index 25825a3cb7b..63e0f162cae 100644 --- a/xact/xs/lrit.go +++ b/xact/xs/lrit.go @@ -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 } @@ -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() @@ -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 }