PUT stores parts of a duplicate EC rule on the nodes of the first identical rule

Aperta
#4,332 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start by reading pkg/services/object/put/distributed.go, especially saveObject and handleECRule, and compare how the duplicate EC rule loop uses rule indexes and node-list positions. Check the surrounding tests for EC placement with duplicate rules and add coverage for different selectors and PreferLocal; done means each rule’s parts go to its own nodes with the correct rule index and placement limits.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug neofs-storage

Expected Behavior

When a container policy has two identical EC rules (same data/parity numbers, e.g. with different selectors), PUT encodes the payload once and stores the parts of rule j on the node list of rule j.

Current Behavior

The loop over duplicate rules in saveObject passes the loop position i of the first rule as the node-list index (distributed.go#L520):

fin, err := handleECRule(i, j, payloadParts, ecRules[ecRuleIdx])

handleECRule uses that argument as objNodeLists[ruleIdx] (L469), so the parts of rule j (with RuleIndex = j in their headers) go to the nodes of the first identical rule. Before the refactoring in 50ed59da4 ("sn/object: Merge REP and EC rule processing") the same loop used nodeLists[j]:

if err := t.applyECRule(signer, obj, j, payloadParts, nodeLists[j]); err != nil {

so this is a regression of that commit. With an initial placement policy and PreferLocal the argument is also used for sumLimitsSinceRule(ruleIdx+1), which expects a position in ruleOrder, not a rule index; the first call at L508 passes ruleIdx there as well.

Possible Solution

Pass len(repRules)+j as the node-list index for the duplicate rule, and pass positions and rule indexes to handleECRule separately.

Context

Found by code reading while analysing #4331. Not reproduced by a test.

Regression

Yes, 50ed59da4.

Lingua principale
Go
Stelle
37
Fork
56
Merge medio
1g 18h
PR unite (30g)
42

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nspcc-dev/neofs-node

Tutte le issue di nspcc-dev/neofs-node

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.