Skip to content

Drop lock bucket#3672

Merged
roman-khimov merged 8 commits intomasterfrom
drop-lock-bucket
Dec 2, 2025
Merged

Drop lock bucket#3672
roman-khimov merged 8 commits intomasterfrom
drop-lock-bucket

Conversation

@roman-khimov
Copy link
Member

No description provided.

@roman-khimov roman-khimov added this to the v0.50.0 milestone Nov 10, 2025
@roman-khimov roman-khimov force-pushed the drop-lock-bucket branch 2 times, most recently from 44855fa to 6b9f67c Compare November 11, 2025 06:13
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 70.51282% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.91%. Comparing base (79e4ff0) to head (7656ba6).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
pkg/core/object/fmt.go 7.69% 12 Missing ⚠️
pkg/local_object_storage/engine/put.go 76.66% 6 Missing and 1 partial ⚠️
cmd/neofs-cli/modules/object/lock.go 0.00% 2 Missing ⚠️
pkg/local_object_storage/metabase/version.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3672      +/-   ##
==========================================
- Coverage   27.32%   26.91%   -0.41%     
==========================================
  Files         657      658       +1     
  Lines       41827    41735      -92     
==========================================
- Hits        11429    11235     -194     
- Misses      29335    29463     +128     
+ Partials     1063     1037      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you drop Lock(..., locked []oid.ID) API from the engine, you must prohibit deprecated LOCK objects with payload on node's API layer. Either i do not see it, or it is not done.

func objectLocked(tx *bbolt.Tx, currEpoch uint64, metaCursor *bbolt.Cursor, idCnr cid.ID, idObj oid.ID) bool {
if associatedWithTypedObject(currEpoch, metaCursor, idObj, object.TypeLock) {
return true
locked, lockID := associatedWithTypedObject(currEpoch, metaCursor, idObj, object.TypeLock)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control service.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact we have a test that does exactly that, that's how it was discovered initially.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control service.

i think it should do it hard, without any expiration/TS/GCMark status, just drop everything. not sure i understand when LOCK can be graveyarded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. But the way it currently works is via a mark. This code can be removed in future. Specifically I think that's the second part of #3476, tombstone processing will be changed significantly as well and that's where the concept of graveyard can be reconsidered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, if you are saying it will be changed

@roman-khimov
Copy link
Member Author

must prohibit deprecated LOCK objects with payload on node's API layer

I think one of the last commits does that, but I can easily miss some code that's related to it.

if err != nil {
e.log.Warn("object put: pool task submitting", zap.Stringer("shard", id), zap.Error(err))
overloaded = errors.Is(err, ants.ErrPoolOverload)
close(exitCh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be dropped now

@roman-khimov
Copy link
Member Author

@roman-khimov roman-khimov added the blocked Can't be done because of something label Nov 20, 2025
@roman-khimov roman-khimov modified the milestones: v0.50.0, v0.51.0 Nov 21, 2025
func objectLocked(tx *bbolt.Tx, currEpoch uint64, metaCursor *bbolt.Cursor, idCnr cid.ID, idObj oid.ID) bool {
if associatedWithTypedObject(currEpoch, metaCursor, idObj, object.TypeLock) {
return true
locked, lockID := associatedWithTypedObject(currEpoch, metaCursor, idObj, object.TypeLock)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, if you are saying it will be changed

return errors.New("system object has payload")
}
if obj.AssociatedObject().IsZero() {
return errors.New("system object has zero associated object")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOCK type can be specified (unexpected bugs with types; logs in debug process)

If there is an engine-level request to drop some object it should be deleted
everywhere because all shards can potentially store it.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Much like we have tombstones and locks broadcasted to all nodes they all
should be broadcasted to all shards to ensure proper meta handling at the shard
level. It's important for subsequent lock processing rework as well since
a lock for LINK object can be accepted by a shard not knowing about this LINK:

--- FAIL: TestStorageEngine_Put_Lock (3.11s)
    --- FAIL: TestStorageEngine_Put_Lock/shards=5 (2.33s)
        --- FAIL: TestStorageEngine_Put_Lock/shards=5/non-regular_target (0.67s)
            put_test.go:110:
                        Error Trace:    /home/rik/dev/neofs-node/pkg/local_object_storage/engine/put_test.go:110
                        Error:          Expected error with "status: code = 2051 message = locking non-regular object is forbidden" in chain but got nil.
                        Test:           TestStorageEngine_Put_Lock/shards=5/non-regular_target

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Lock can be deleted manually and in this case it's no longer active even
if it's not yet physically removed.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
1. If any shard returns something like "object is locked" it's final, there is
   no point in continuing iterations.
2. Wrap and return the last error from the method, don't lose it.
3. Simplify putToShard signature, single error is sufficient here.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
It's no longer needed since API 2.18, we have all the data in meta index. This
also removes Lock() method itself, a simple Put() of a LOCK object is
sufficient now.

A part of #3476.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
CLI creates this object according to some rules known to CLI only, this
should be communicated.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
pkg/local_object_storage/engine/lock_test.go:176:2    staticcheck  S1021: should merge variable declaration with assignment on next line

Not related to recent changes.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
@roman-khimov
Copy link
Member Author

@roman-khimov
Copy link
Member Author

@roman-khimov roman-khimov merged commit ae46bc4 into master Dec 2, 2025
21 of 22 checks passed
@roman-khimov roman-khimov deleted the drop-lock-bucket branch December 2, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Can't be done because of something

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants