From 705237c6a840d1cd23f6ffed873afcf1b42f4e0d Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 7 Nov 2024 19:13:02 +0300 Subject: [PATCH] [#XX] node: Introduce temporary dual service support Signed-off-by: Airat Arifullin --- cmd/frostfs-node/container.go | 1 + cmd/frostfs-node/netmap.go | 9 +++++++++ go.mod | 2 ++ go.sum | Bin 41820 -> 41816 bytes 4 files changed, 12 insertions(+) diff --git a/cmd/frostfs-node/container.go b/cmd/frostfs-node/container.go index 9c3505922..b35cf799c 100644 --- a/cmd/frostfs-node/container.go +++ b/cmd/frostfs-node/container.go @@ -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) diff --git a/cmd/frostfs-node/netmap.go b/cmd/frostfs-node/netmap.go index 58e066fc9..9d488301c 100644 --- a/cmd/frostfs-node/netmap.go +++ b/cmd/frostfs-node/netmap.go @@ -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()) diff --git a/go.mod b/go.mod index 8a70c3819..da6d28557 100644 --- a/go.mod +++ b/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 diff --git a/go.sum b/go.sum index 9778f91e21ddd2973a78e980fd665851afdc20bd..2b2404c6215ced80d1c14752cabd48f7a7772c13 100644 GIT binary patch delta 150 zcmca}jOoTPrVafpli#y)ZC=1C#WwjFGapxCVo_#VX--aN-sCCsObg~1h_2ymNi>3nrVmmU; delta 128 zcmca{jOorXrVafplm9VtOuoV;?r3CaXlSXMoMd5WoN8pAXklcmkYQ+5oLZ1;>6TiW z@0pidneJiet*>qDqa9gbn&g$?o*9;@pYQJMVdk1!V3a)hA+rX^Bq2CaT?nTo9%Wx_7