Support daysFromStartingToCancelingUnfinishedLargeFiles and preserve it across Attrs and Update
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Start with b2/b2.go for LifecycleRule, then trace lifecycle conversion through b2/baseline.go, base/base.go, and internal/b2types/b2types.go; inspect x/consistent/consistent.go for the save path. Add coverage using an HTTP fake for the Attrs/Update round trip and for setting the field through NewBucket and Update. Done means every lifecycle field survives the round trip and consistent saves preserve rules.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
B2 lifecycle rules have a fourth field, daysFromStartingToCancelingUnfinishedLargeFiles, which is the server-side way to clean up unfinished large files. blazer's LifecycleRule (and the base and b2types types under it) does not have it, so:
- blazer users cannot set this rule.
- The documented update pattern (
Attrs, modify,Update; see the docs onBucket.UpdateandIsUpdateConflict) rewrites lifecycle rules from blazer's partial copy and drops the field from rules configured elsewhere (web console, CLI, other SDKs).x/consistentdoes this on every save.
Unfinished large files are a normal outcome in blazer (a writer that fails without WithCancelOnError, a process that exits mid-upload). Their parts are stored and billed until cancelled, so silently removing the cleanup rule changes the bucket's storage costs without any signal.
Current behavior
At a5e0d13:
- b2/b2.go:375-387:
LifecycleRulehasPrefix,DaysNewUntilHidden,DaysHiddenUntilDeleted. - b2/baseline.go:519-527 (
attrs), :399-411 (updateBucket) and :253-260 (createBucket) copy those three. - base/base.go:773-777 and internal/b2types/b2types.go:83-87 define the same three, so the field is dropped on decode.
- b2/baseline.go:395-411: since merged Backblaze/blazer#78,
Updatesends rules only whenLifecycleRulesis non-nil, butAttrsreturns a non-nil slice whenever the bucket has rules, so anAttrs/Updateround trip always rewrites them. - x/consistent/consistent.go:321-325:
savewritesAttrsback withUpdate.
Reproduced locally against an HTTP fake: b2_list_buckets returned a rule with daysFromHidingToDeleting: 1 and daysFromStartingToCancelingUnfinishedLargeFiles: 7; Attrs, adding one bucket-info key, and Update sent:
"lifecycleRules":[{"daysFromHidingToDeleting":1,"fileNamePrefix":""}]
A rule that only cancels unfinished uploads comes back as {"fileNamePrefix":""}.
Expected behavior
Callers can set the rule, and an Attrs/Update round trip keeps every lifecycle field it read.
Proposed change
- Add the field (for example
DaysUnfinishedUntilCanceled int) tob2.LifecycleRule,base.LifecycleRuleandb2types.LifecycleRulewithomitempty, and copy it increateBucket,attrs,updateBucketand thebasedecode paths. - Keep the raw lifecycle JSON from the last read and send it back unchanged when the caller did not modify
LifecycleRules, so future fields survive. - Mention the rule in the
Writerdocs next toWithCancelOnErrorandResume.
Acceptance criteria
AttrsthenUpdatesends back every lifecycle field received (HTTP fake).NewBucketandUpdatecan set the new field, andAttrsreturns it.x/consistentsave preserves a bucket's lifecycle rules exactly.
Related
Open Backblaze/blazer#108 is a separate updateBucket defect. Merged Backblaze/blazer#78 fixed sending an explicit empty rule list and stopped Update sending rules when LifecycleRules is nil; it did not add the field.
- 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 ·