nspcc-dev / nspcc-dev/neofs-node

Engine Get logic shouldn't depend on shard internals

Open
#3,024 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement I4 neofs-storage S2 U4
Dominant language
Go
Stars
38
Forks
51
Avg merge
1d 20h
Merged PRs (30d)
38

Description

Is your feature request related to a problem? Please describe.

I'm always frustrated when I look at the code added in #1199 to fix #1186:

  • it's very specific, the case of "meta exists elsewhere" is handled, but things like "meta doesn't exist while the object is present" is no
  • it leaks shard internals to engine, engine should not care about metabases, it just tries to Get something
  • it adds some overhead

Describe the solution you'd like

I'd like to revert it and get back to the simple logic of:

  • either we have a metabase and then we trust it
  • or we never trust it for Gets and always get down to the blobstor itself

The answer is not that obvious, testing against the blobstor is expensive, but most of the time we expect it to succeed anyway because we're going to the most probable shard and with fstree it's basically an FS path check, a single syscall. Going into meta is some memory reads which is cheaper in general, but meta is a contention point for many operations, so what happens under which load is an open question.

Describe alternatives you've considered

Corrupted meta can be fixed in the background, btw. We have background routines that go over data, they can check meta consistency and fix it (both ways, get missing object if we have meta or add meta if we have an object).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Engine Get path and its interaction with metabases, shards, blobstor, and fstree. Review the logic added for #1199 and the background consistency routines, then resolve the trade-off between trusting metadata and checking blobstor before defining the intended behavior for inconsistent or missing metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.