Skip to content

Feat/meta/sn#3991

Merged
roman-khimov merged 7 commits into
masterfrom
feat/meta/sn
Jun 17, 2026
Merged

Feat/meta/sn#3991
roman-khimov merged 7 commits into
masterfrom
feat/meta/sn

Conversation

@carpawell

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.88629% with 503 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.97%. Comparing base (c3ae25d) to head (688521e).

Files with missing lines Patch % Lines
cmd/neofs-node/meta.go 6.40% 117 Missing ⚠️
pkg/services/meta/meta.go 25.43% 81 Missing and 4 partials ⚠️
pkg/services/sidechain/sidechain.go 0.00% 80 Missing ⚠️
pkg/services/meta/storage.go 3.63% 53 Missing ⚠️
pkg/services/object/put/distributed.go 14.03% 48 Missing and 1 partial ⚠️
pkg/services/meta/blocks.go 0.00% 36 Missing ⚠️
pkg/core/object/replicate.go 13.15% 33 Missing ⚠️
pkg/services/object/put/streamer.go 31.81% 14 Missing and 1 partial ⚠️
pkg/services/meta/notifications.go 0.00% 14 Missing ⚠️
pkg/network/address.go 0.00% 8 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3991      +/-   ##
==========================================
- Coverage   27.70%   26.97%   -0.73%     
==========================================
  Files         682      684       +2     
  Lines       47029    46513     -516     
==========================================
- Hits        13029    12547     -482     
- Misses      32756    32780      +24     
+ Partials     1244     1186      -58     

☔ View full report in Codecov by Harness.
📢 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.

@cthulhu-rider cthulhu-rider left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not finished

Comment thread pkg/core/metachain/meta/meta_test.go
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/meta.go Outdated
Comment thread pkg/services/meta_new/meta.go Outdated
Comment thread pkg/services/meta_new/meta.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated

@cthulhu-rider cthulhu-rider left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

finished. Lets fix everything and merge

@AnnaShaleva may u pls check chain configuration?

Comment thread pkg/services/meta/meta.go Outdated
Comment thread pkg/services/meta/meta.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go
Comment thread pkg/services/object/put/distributed.go Outdated
Comment thread pkg/services/object/put/distributed.go
Comment thread cmd/neofs-node/meta.go Outdated
Comment thread cmd/neofs-node/meta.go
Comment thread cmd/neofs-node/meta.go Outdated
Comment thread cmd/neofs-node/meta.go Outdated
Comment thread cmd/neofs-node/meta.go
Comment thread pkg/services/meta/meta.go
// notification work; it is required to always read notifications without
// any blocking or making additional RPC.
notificationBuffSize = 100
notificationBuffSize = 10000

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it approved by @roman-khimov?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is an address + pointer buff channel, what cons may we have? ~703KB of memory

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i can change it to any value. do you have a suggestion? i just had an experience with deadlock with neo-go subscription, so this is why this big value was chosen

@AnnaShaleva AnnaShaleva Jun 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's why I'm asking. Increasing buffer size is not a solution to the deadlock problem. It will make the problem more hidden, that's it.

If there's a deadlock, it should be fixed in some other (explicit) way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Increasing buffer size is not a solution to the deadlock problem

we are balancing b/w notification handling speed and storage speed. i guess it is another thing for exploring in load testing (yet not answered)

Comment thread pkg/services/object/put/streamer.go
Comment thread pkg/services/sidechain/sidechain.go
Comment thread pkg/services/sidechain/sidechain.go
Comment thread pkg/services/sidechain/sidechain.go Outdated

@AnnaShaleva AnnaShaleva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tests are failing. Other than that looks legit as a prototype.

Comment thread cmd/neofs-node/meta.go Outdated
Comment thread pkg/innerring/innerring.go Outdated
Comment thread pkg/util/network.go Outdated
@carpawell

Copy link
Copy Markdown
Member Author

Tests are failing. Other than that looks legit as a prototype.

They should be adopted, yes. And there are other problems. Config check and changelog are not accepted to the experimental things.

@cthulhu-rider cthulhu-rider left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems good to me overall

Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated

func (m *Meta) notificationHandler(ctx context.Context, buff <-chan *state.ContainedNotificationEvent) {
for {
if len(buff) >= notificationBuffSize-1 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here.

Comment thread pkg/services/meta_new/meta.go Outdated
on.m.Unlock()

if ok {
on.metaSvc.taskQueue <- storageTask{addr: addr, o: &sub.objHeader}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it make any difference? Local HEAD should be pretty fast.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

why HEAD smth, when a node already has header in memory?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it also may be non-local, why not?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code is more complicated for sure. Whether it's worth this complication or not is an open question.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

8 nodes, REP 3: we read (block writing at the same time) our own metabase, OR in 62% go to a different node for a header we had in memory just about ~25ms ago. why?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see any difference in chances, in 3 out of 8 cases it's local, in 5 out of 8 it's networked. Irrespective of this structure. Let's keep it as is for now, this can be checked in future as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

5 out of 8 it's networked

and it means this node collected header, has it already locally in memory, collected every signature, sent tx to the chain, expects the results in ~25ms, and... decided to drop this header to request it soon again from another node. to me, this is "read header from network" vs "read header from memory". i think i do not understand smth

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you talking about forwarding in-container node? That'd be 1 out of 5 not storing the object.

Comment thread pkg/services/meta_new/meta.go Outdated
wg.Go(func() { m.storager(ctx, m.taskQueue) })

m.chain.SubscribeForBlocks(m.bCh)
m.chain.SubscribeForNotifications(m.evsCh)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like this can be done via JSON-RPC as well. Can we have this mode (non-local chain) for nodes with IR nearby?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems like this can be done via JSON-RPC as well

why is it better in any way?

Can we have this mode (non-local chain) for nodes with IR nearby?

what mode would it be? SN that does not have a local chain? what chain does it put it in then?

this is an interface, so not problem to have any chain source there, but i do not fully inderstand your intention

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty easy and already discussed a number of times, IR+SN combo has two chains onboard while it could only have one. We can also experiment with non-local chains, but let's move this to another issue, #4022

Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/object/server.go
Comment thread pkg/services/sidechain/sidechain.go
Comment thread cmd/neofs-node/meta_new.go Outdated
@carpawell carpawell force-pushed the feat/meta/sn branch 2 times, most recently from 7618a13 to e21f8b1 Compare June 16, 2026 19:50
Comment thread pkg/services/meta/storage.go Outdated
10_000_000 meant nothing, GAS factor is 1_0000_0000. Also, new value means
something at least.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
carpawell and others added 5 commits June 17, 2026 19:24
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
It is available starting from v0.119.0. This should speed broadcast up, which is
critical for metadata chain.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Just drop the old one, use new instead, no functional changed in the new one.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
@roman-khimov roman-khimov merged commit 1f65db8 into master Jun 17, 2026
@roman-khimov roman-khimov deleted the feat/meta/sn branch June 17, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants