nspcc-dev / nspcc-dev/neofs-node

Support unpaid containers rollback

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

Nobody has claimed this yet.

bug I3 neofs-storage S3 U4
Dominant language
Go
Stars
38
Forks
51
Avg merge
1d 20h
Merged PRs (30d)
38

Description

When an unpaid container is dropped (from SN's storage, not from the whole network) no SN is going to update load reports with zero values (but the container still exists), so no new object can be accepted even if balance > 0.

Expected Behavior

  1. You have not enough balance, you lose your data.
  2. You store zero bytes, but you have positive balace still, you should be able to start your NeoFS life from scratch.
  3. You are able to store objects and pay for them again.

Current Behavior

Very likely, SNs stop reporting values after no container info is found in metabase: https://github.com/nspcc-dev/neofs-node/blob/a4005c91c97104a0181842f75e86d7230cdb10e0/pkg/local_object_storage/metabase/containers.go#L189-L194, so fake reports are stuck forever.

Possible Solution

Have two versions of DeleteContainer (bool flag maybe): one is for complete container removal (event from FS chain), and one for data cleanup only.

Steps to Reproduce (for bugs)

  1. Store objects
  2. Remember its reports
  3. Stop paying for the container
  4. Wait for next epoch, and look at load reports

Context

https://github.com/nspcc-dev/neofs-node/pull/3650#discussion_r2545359158

Regression

No

Your Environment

v0.50.0

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 in pkg/local_object_storage/metabase/containers.go at the linked handling around lines 189-194, then review the DeleteContainer discussion in PR #3650. Reproduce the unpaid-container flow by storing objects, waiting for the next epoch, and checking load reports. Done means data cleanup leaves the container able to report zero usage and accept objects again when its balance is positive.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
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.