From d055168e2a9651c357e4358c1dcc392bb4ae4718 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 14 Aug 2024 13:47:50 +0300 Subject: [PATCH] [#1135] ir: Add healthstatus RECONFIGURING Signed-off-by: Ekaterina Lebedeva --- cmd/frostfs-ir/config.go | 6 ++++++ go.mod | 6 +++--- go.sum | Bin 39512 -> 39512 bytes pkg/innerring/state.go | 12 ++++++++++++ pkg/services/control/ir/types.pb.go | Bin 7799 -> 8051 bytes pkg/services/control/ir/types.proto | 3 +++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cmd/frostfs-ir/config.go b/cmd/frostfs-ir/config.go index 955195477..4eaac845c 100644 --- a/cmd/frostfs-ir/config.go +++ b/cmd/frostfs-ir/config.go @@ -7,6 +7,7 @@ import ( configViper "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common/config" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" + control "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control/ir" "github.com/spf13/viper" "go.uber.org/zap" ) @@ -81,6 +82,10 @@ func watchForSignal(cancel func()) { return case <-sighupCh: log.Info(logs.FrostFSNodeSIGHUPHasBeenReceivedRereadingConfiguration) + if !innerRing.CompareAndSwapHealthStatus(control.HealthStatus_READY, control.HealthStatus_RECONFIGURING) { + log.Info(logs.FrostFSNodeSIGHUPSkip) + break + } err := reloadConfig() if err != nil { log.Error(logs.FrostFSNodeConfigurationReading, zap.Error(err)) @@ -92,6 +97,7 @@ func watchForSignal(cancel func()) { if err != nil { log.Error(logs.FrostFSNodeConfigurationReading, zap.Error(err)) } + innerRing.CompareAndSwapHealthStatus(control.HealthStatus_RECONFIGURING, control.HealthStatus_READY) log.Info(logs.FrostFSNodeConfigurationHasBeenReloadedSuccessfully) } } diff --git a/go.mod b/go.mod index 09a098502..196b4d463 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.2-0.20231222162921-eb75782795d2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect @@ -120,8 +120,8 @@ require ( golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/ini.v1 v1.67.0 // indirect lukechampine.com/blake3 v1.2.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index 1034ff61fe818a58da31dd01d20510fac1cbf80a..bd6d8588294ed84a9a7329f71cafb0ba382888b8 100644 GIT binary patch delta 336 zcmcbyh3Uo?rVU>FM#g#u3K@o0p*|LdrWK)E=m3X8948 zPDy@Ic|Jy=Ze_)jYxtEIjW^Hdx2SctFf=hRH8Rw-G)XixN-;||GBP#?85iW1=~h%$ zX>6{aTM%53QW@;zQWTn!SrD$D;!$24RGwk%WvuOJ8I~SmGI@TV=wyRF;mJpPguJks zr=Om$mz$pgGB(Q8Gqch-t0XrwKQSxZ!^Pb#+uS*|G(Du!qa>ir*Tc~yG$c1PyD~Ay z6>6+1PAB^1MHZTc`dJ30`uJMvM;aJ2CqZW2#DD;Ix&}uPy1H*>By@E-5 z1@F*Xcm-|ZvKRRBZ8w$ert)P=0QJWC7+snSn2%bi;*lBl2b!*%^Kg{LS&+N8ofd62 zeVKLuEQiw?WG zF1w53!sMT3)8!EuW_S+)<3s zSh$VAmb;!G1R|n<%g^HMPpvWnm|%=+bc9q4p@uQyJ8B-KwhY<56UZ|=Ugr6*t2tTk eA!4sQS=vCA#4zKRsmb|yX_@JzMVWc&dR&|ysfjry8NnrqC8fpjL9WjJer}%b zp+TO0?h43K3bqO+lix9~5#ltlQcyxsH+dS%dSy;jF(oSn1TfLz;;iM;oGimGu{nV? zhnvYPaq~F=5vF=WBOL{U3PVE>X^;peQ$VCCSlq-E#5OSolWAZw6-=6eNlP$k4kAs# zDxtb8fwlp)L6m}}4Glnw3{1cpAV!1PlivwhihvZGgSlp4bIpPFO|};Hg-C!6HiPI) o21?9!HDHWTp`Q81`5 zH`M`>W+ougBv}V2F&!cS5i$cy8>N9Hen2HGL2Av7KqN%s9KYt|CQ+5i>-jl1ZxB7q F2>@YYCQ|?a diff --git a/pkg/services/control/ir/types.proto b/pkg/services/control/ir/types.proto index 9b6731cf8..901a55918 100644 --- a/pkg/services/control/ir/types.proto +++ b/pkg/services/control/ir/types.proto @@ -26,4 +26,7 @@ enum HealthStatus { // IR application is shutting down. SHUTTING_DOWN = 3; + + // IR application is reconfiguring. + RECONFIGURING = 4; }