nspcc-dev / nspcc-dev/neofs-node

node: Refactor using `StorageEngine` in `Object` service

Open
#1,834 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Object service server of storage node uses engine.StorageEngine type directly almost everywhere. Such code architecture doesn't allow to tune local storage behavior. For example, in #1798 there was a need to block all local operations, but on Object server only: Control service should still call the engine.

I propose to refactor engine's usage as it done it ObjectService.Put server

https://github.com/nspcc-dev/neofs-node/blob/4eb0ed11f8e56beee3dfbee632cb4b9cad3bb47c/pkg/services/object/put/local.go#L11-L16

Each component should precisely document expected behavior of local object storage by itself via locally defined interface. As a bonus, instance can be easily mocked for testing.

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 with the ObjectService.Put implementation in pkg/services/object/put/local.go, then locate the other Object service uses of engine.StorageEngine. Define locally scoped interfaces that document each component's expected local-storage behavior, replace direct engine usage, and ensure the interfaces can be mocked for testing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.