Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node/objects: Distribute objects in container via replication protocol #2802

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

cthulhu-rider
Copy link
Contributor

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 22.61905% with 130 lines in your changes missing coverage. Please review.

Project coverage is 23.64%. Comparing base (ecc0314) to head (92a01fe).

Files Patch % Lines
pkg/services/object/put/proto.go 59.37% 22 Missing and 4 partials ⚠️
cmd/neofs-node/transport.go 0.00% 25 Missing ⚠️
pkg/services/object/put/distributed.go 0.00% 25 Missing ⚠️
pkg/services/object/put/streamer.go 0.00% 16 Missing ⚠️
pkg/services/object/put/local.go 0.00% 11 Missing ⚠️
pkg/services/object/put/remote.go 0.00% 9 Missing ⚠️
cmd/neofs-node/object.go 0.00% 8 Missing ⚠️
pkg/services/object/put/service.go 0.00% 6 Missing ⚠️
pkg/network/cache/multi.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2802      +/-   ##
==========================================
+ Coverage   23.61%   23.64%   +0.02%     
==========================================
  Files         770      772       +2     
  Lines       44527    44651     +124     
==========================================
+ Hits        10514    10556      +42     
- Misses      33163    33241      +78     
- Partials      850      854       +4     

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

@cthulhu-rider cthulhu-rider marked this pull request as ready for review April 12, 2024 13:05
@roman-khimov roman-khimov added the blocked Can't be done because of something label Apr 12, 2024
@roman-khimov
Copy link
Member

post-0.41.0

@roman-khimov roman-khimov removed the blocked Can't be done because of something label May 2, 2024
pkg/services/object/put/distributed.go Show resolved Hide resolved

// SendReplicationRequestToNode connects to described node and sends prepared
// replication request message to it.
func (x *transport) SendReplicationRequestToNode(ctx context.Context, req []byte, node coreclient.NodeInfo) error {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't binary object be here as arg while request collection is placed inside this func?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope for the sake of performance: node sends same object to several nodes

pkg/services/object/put/proto.go Show resolved Hide resolved
pkg/services/object/put/distributed.go Show resolved Hide resolved
Method can be used to send raw requests. Nothing prevents the
implementation to be done.

Signed-off-by: Leonard Lyubich <[email protected]>
Previously, storage nodes always sent "ready" objects after client data
slicing via NeoFS API `ObjectService.Put` RPC. Recently, NeoFS protocol
was extended with `ObjectService.Replicate` RPC allowing to replicate
object from one container node to another. New RPC is more efficient,
and now used by Policer+Replicator tandem to replicate objects on
shortage. Actually, when `ObjectService.Put` server makes initial object
save, it does completely the same.

In total, when `Put` server represents storage node from the container,
it can use `Replicate` RPC for better performance. An additional
advantage is the one-time encoding of the protocol message, which is
reused for sending to different nodes. This reduces the memory cost of
processing each data stream.

Refs #2316.

Signed-off-by: Leonard Lyubich <[email protected]>
Signed-off-by: Leonard Lyubich <[email protected]>
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.

I think, we need a deep refactor in the distribution code, it went through a lot of changes. We have many "dynamic" code (where []byte may mean different things, obj and encodedObject are neighbors fields, etc), traverser is not the only one who knows about object placement, some TODOs and proto code are also here but we need to go further.

@carpawell carpawell merged commit e6eeda1 into master Jul 4, 2024
19 of 22 checks passed
@carpawell carpawell deleted the put-replicate branch July 4, 2024 16:04
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.

3 participants