nspcc-dev / nspcc-dev/neofs-node
Support unpaid containers rollback
Nobody has claimed this yet.
- 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
- You have not enough balance, you lose your data.
- You store zero bytes, but you have positive balace still, you should be able to start your NeoFS life from scratch.
- 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)
- Store objects
- Remember its reports
- Stop paying for the container
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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