Skip to content

Initial support for ReplicateV2 - #4168

Open
cthulhu-rider wants to merge 7 commits into
masterfrom
replicate-v2
Open

Initial support for ReplicateV2#4168
cthulhu-rider wants to merge 7 commits into
masterfrom
replicate-v2

Conversation

@cthulhu-rider

@cthulhu-rider cthulhu-rider commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@cthulhu-rider cthulhu-rider changed the title Initial support fot ReplicateV2 Initial support for ReplicateV2 Sep 9, 2026
@cthulhu-rider
cthulhu-rider force-pushed the replicate-v2 branch 3 times, most recently from 70eadcd to be39b31 Compare September 9, 2026 15:39
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.75676% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.07%. Comparing base (b513ecb) to head (da20e97).

Files with missing lines Patch % Lines
pkg/services/object/server.go 44.32% 54 Missing ⚠️
pkg/services/object/put/remote.go 70.31% 19 Missing ⚠️
pkg/core/client/client.go 0.00% 3 Missing ⚠️
pkg/services/object/put/distributed.go 80.00% 2 Missing ⚠️
cmd/neofs-node/object.go 0.00% 1 Missing ⚠️
pkg/services/object/common.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4168      +/-   ##
==========================================
+ Coverage   31.03%   31.07%   +0.03%     
==========================================
  Files         673      672       -1     
  Lines       40673    40726      +53     
==========================================
+ Hits        12623    12654      +31     
- Misses      28050    28072      +22     

☔ 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 force-pushed the replicate-v2 branch 3 times, most recently from 9239cb9 to e0aa31f Compare September 9, 2026 15:55
@cthulhu-rider
cthulhu-rider marked this pull request as ready for review September 9, 2026 16:58
Comment thread pkg/services/object/server.go
return grpcstatus.Error(grpccodes.Unimplemented, "no longer supported, use SearchV2")
}

func readFirstReplicateV2Request(stream protoobject.ObjectService_ReplicateV2Server) (*protoobject.ReplicateV2Request_Init, *protostatus.Status, error) {

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.

Can return (*protoobject.ReplicateV2Request_Init, error) and use apistatus.Error where appropriate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this would lead to a "there and back" in most cases. Don't think it's worth it

Comment thread pkg/core/client/client.go Outdated
// CompareAPIVersion performs three-way comparison of API server version against
// the given one.
func CompareAPIVersion(c MultiAddressClient, major uint32, minor uint32) int {
cv := c.APIVersion()

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.

Can have version.Version here as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread pkg/core/client/client.go Outdated

// CompareAPIVersion performs three-way comparison of API server version against
// the given one.
func CompareAPIVersion(c MultiAddressClient, major uint32, minor uint32) int {

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.

Can accept version.Version here and have a static var somewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread pkg/services/object/put/remote.go Outdated
chunkReqNum++
}

chunkReqBufItems := make([]*[]byte, chunkReqNum)

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.

A lot of memory. Should use less.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

improved

Brings ReplicateV2 object API. Makes SN to serve API v2.27.

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
As close to `Replicate` as possible. Various optimizations will be done
in the future.

Refs #4157.

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
This will be useful to implement switch b/w Replicate and ReplicateV2
using remote conn.

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
These are the minimum necessary functional changes. They are not optimal
due to duplicated requests when accessing multiple nodes and the
request encoding of unary Replicate RPC even if it is not used.
Optimizations will be made in the future.

Refs #4157.

Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Signed-off-by: Leonard Liubich <leonard@morphbits.io>
Signed-off-by: Leonard Liubich <leonard@morphbits.io>
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.

2 participants