Honor ListPrefix with ListUnfinished and fix listing cursor and page-size edge cases
I maintainer di solito rispondono entro 1 giorno
@ffumero2003 ci sta già lavorando.
Dal 28/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Context
ListPrefixis ignored withListUnfinished. The unfinished-file lister never sendsnamePrefixtob2_list_unfinished_large_files, soList(ctx, ListPrefix("app/tmp/"), ListUnfinished())returns every unfinished large file in the bucket. A cleanup loop that cancels what it lists then cancels in-progress uploads under other prefixes.Writer.Resumealso pages through the whole bucket.- Version listing may stop early with a delimiter (needs confirmation against B2). Paging continues only when both
nextFileNameandnextFileIdare set. With a delimiter the next entry can be a folder with no file ID; the Python SDK continues onnextFileNamealone. If B2 returns a name without an ID there, blazer ends the listing withErr() == nil. ListPageSizedefault differs from its doc for file listings. The doc says 1000 (100 for unfinished large files), but file-name and file-version listings sendmaxFileCount: 0(those request fields have noomitempty), leaving the page size to the server. B2 documents a default of 100 (its handling of an explicit 0 is not confirmed here); if it applies that default, a default listing makes up to ten times more calls than documented. The 1000 cap also prevents using B2's 10,000 maximum. Unfinished-file listings are not affected: that request already omits a zero count.ListKeysstops on an empty page that carries a cursor, the same case fixed for objects in Backblaze/blazer#70.
Current behavior
At a5e0d13:
- b2/iterator.go:324-336: no prefix reaches the API and the next cursor drops it; internal/b2types/b2types.go:430-434: the request type has
bucketId,startFileId,maxFileCountonly; b2/writer.go:420:Writer.Resumelists withListPrefix(w.name)andListUnfinished(). - b2/iterator.go:261-269:
if name != "" && id != ""gates the next version page. - b2/iterator.go:100-104 and :214-221: a page size of 0 passes through; internal/b2types/b2types.go:342 and :355:
maxFileCountwithoutomitemptyon the file-name and file-version requests (the unfinished request at :433 hasomitempty); b2/sync/sync.go:178: the sync engine lists the destination withbucket.List(ctx, b2.ListPrefix(prefix))and no page size, so it uses this default. - b2/key.go:149-151:
if len(ks) == 0 { return nil, "", io.EOF }before checkingnext.
Expected behavior
Listings honor every option they accept, continue until the server reports no more entries, and use the documented page size.
Acceptance criteria
- R1.
List(ListPrefix(p), ListUnfinished())returns only names underp, and the request carriesnamePrefix. - R2. A version page with
nextFileNameand nonextFileIdcontinues. - R3. The default file-name and file-version iterators send the documented page size.
- R4.
ListKeyswith an empty page and a cursor does not returnio.EOF. - R5. A live check covers delimiter plus versions across a folder boundary.
In scope
Proposed change
- Add
NamePrefix string(namePrefix,omitempty) toListUnfinishedLargeFilesRequest, pass it throughbase,b2BucketandbeBucket, and keep it in the cursor. Until then, filter by prefix on the client. - Continue version listings when
nextFileNameis set, sendingstartFileIdonly when present. - For file-name and file-version listings, send the documented default page size (or fix the doc) and allow up to 10,000.
- In
ListKeys, returnio.EOFonly whennextis empty.
Out of scope
- Unrelated work outside the components and behavior described in In scope.
Verification
Run the repository regression checks with live credentials unset:
unset B2_APPLICATION_KEY_ID B2_APPLICATION_KEY B2_ACCOUNT_ID B2_ACCOUNT_KEY
go build ./...
go vet ./...
go test -race -count=1 ./b2/... ./base
- Assert literal wire fields/cursors and results for prefix-scoped unfinished listing, name-only version cursors, page-size defaults, and empty key pages with a continuation cursor.
- Run the required live delimiter/version boundary check separately, recording credentials/environment requirements and actual output.
- Expected result: the checks above succeed and the observable outcomes in Acceptance criteria are demonstrated. If a check cannot run, report
Could not run because: ...; if it starts but fails, reportCould not complete because: .... A skipped check is not a pass.
Links
Merged Backblaze/blazer#70 fixed early termination on empty pages for file listings. Open Backblaze/blazer#157 (resume unfinished large-file uploads in sync) needs to find the unfinished file for one name, so it depends on item 1.
- Lingua principale
- Go
- Stelle
- 66
- Fork
- 18
- Merge medio
- 1g 10h
- PR unite (30g)
- 132
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Backblaze/blazer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Bucket.Attrs never returns ReplicationConfig: replication configuration is write-onlyForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
test: skip the fuzz non-vacuity guard when replaying a single seedForse già presa @ffumero2003 l’ha presa 5 giorni fa. Apertatesting
Backblaze/blazer#330 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Backblaze/blazer
Issue simili
-
needs-triage typo
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
llm-d-incubation/llm-d-scaling-manager#122 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue severity: low tech-debt
Difficoltà 2/5 Mezza giornata Idoneità per principianti 75/100
TMHSDigital/subenum#329 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Backend summarize min() / max() panics when a field has no numeric valuesForse già presa @weng5e l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
grafana/grafana-infinity-datasource#1832 ·
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
GillMacedo/godebugdiff#13 ·