Object requests are answered 1028 bad request when the container cannot be read from the chain

Aperta
#4,321 2 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
Mezza giornata
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, grpc
Ambito
api, backend

Direzione di ricerca

Start in pkg/services/object/acl/v2/service.go at findRequestInfo, where the container source error is returned unchanged, and at decodeAndVerifyBearerTokenCommon, which already maps an epoch read failure to ServerInternal. The object handlers in pkg/services/object/server.go (HEAD, Put, Delete, Get, SearchV2) turn plain errors into BadRequest. Done when a container read failure yields ServerInternal (1024) rather than BadRequest (1028), while ContainerNotFound stays as is.

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

Descrizione

bug I4 neofs-storage S4 U3

Expected Behavior

If the storage node cannot read the container from the FS chain, it answers object requests with an internal error status (1024), because the request itself is fine.

Current Behavior

findRequestInfo returns the error from the container source unchanged (service.go#L540-L543). The morph client returns an RPC failure as a plain error, and every object handler turns a plain error from the request info extractor into BadRequest (1028), e.g. HEAD at server.go#L745-L750 (same at Put, Delete, Get, SearchV2). The guard came with c7d99f80b ("object: return BadRequest where appropriate").

Observed in #4318 while the only inner ring node was down:

code = 1028 ... could not perform test invocation (getRevisionedInfo)

BadRequest says the client sent a malformed request, so clients have no reason to retry it.

Possible Solution

Classify a container source failure (that is not already a status such as ContainerNotFound) as ServerInternal where it is read, as decodeAndVerifyBearerTokenCommon already does for an epoch read failure (service.go#L407-L412), so the BadRequest guard leaves it alone.

Regression

Probably since c7d99f80b; before it the plain error became 1024.

Your Environment

master 1f0d51b5d, found by code reading while analysing #4318; the 1028 answer is from the #4318 reproduction.

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

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.