forked from TrueCloudLab/frostfs-node
[#XX] node: Introduce temporary dual service support
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
0d46afa3c2
commit
705237c6a8
4 changed files with 12 additions and 0 deletions
|
@ -64,6 +64,7 @@ func initContainerService(_ context.Context, c *cfg) {
|
|||
|
||||
c.cfgGRPC.performAndSave(func(_ string, _ net.Listener, s *grpc.Server) {
|
||||
containerGRPC.RegisterContainerServiceServer(s, server)
|
||||
s.RegisterService(legacyServiceDesc(containerGRPC.ContainerService_ServiceDesc), server)
|
||||
})
|
||||
|
||||
c.cfgObject.cfgLocalStorage.localStorage.SetContainerSource(cnrRdr)
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
|
@ -166,11 +167,19 @@ func initNetmapService(ctx context.Context, c *cfg) {
|
|||
|
||||
c.cfgGRPC.performAndSave(func(_ string, _ net.Listener, s *grpc.Server) {
|
||||
netmapGRPC.RegisterNetmapServiceServer(s, server)
|
||||
s.RegisterService(legacyServiceDesc(netmapGRPC.NetmapService_ServiceDesc), server)
|
||||
})
|
||||
|
||||
addNewEpochNotificationHandlers(c)
|
||||
}
|
||||
|
||||
func legacyServiceDesc(sd grpc.ServiceDesc) *grpc.ServiceDesc {
|
||||
sdLegacy := new(grpc.ServiceDesc)
|
||||
*sdLegacy = sd
|
||||
sdLegacy.ServiceName = strings.ReplaceAll(sd.ServiceName, "frost.fs", "neo.fs.v2")
|
||||
return sdLegacy
|
||||
}
|
||||
|
||||
func addNewEpochNotificationHandlers(c *cfg) {
|
||||
addNewEpochNotificationHandler(c, func(ev event.Event) {
|
||||
c.cfgNetmap.state.setCurrentEpoch(ev.(netmapEvent.NewEpoch).EpochNumber())
|
||||
|
|
2
go.mod
2
go.mod
|
@ -2,6 +2,8 @@ module git.frostfs.info/TrueCloudLab/frostfs-node
|
|||
|
||||
go 1.22
|
||||
|
||||
replace git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241107121119-cb813e27a823 => git.frostfs.info/aarifullin/frostfs-sdk-go v0.0.0-20241107160725-0219aeff45e1
|
||||
|
||||
require (
|
||||
code.gitea.io/sdk/gitea v0.17.1
|
||||
git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.0
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
Loading…
Reference in a new issue