ir: Set extra wallets on SIGHUP #339
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#339
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:feature/125-ir-sighup-log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #125
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -415,6 +415,7 @@ const (
FrostFSIRApplicationStopped = "application stopped" // Info in ../node/cmd/frostfs-ir/main.go
FrostFSIRCouldntCreateRPCClientForEndpoint = "could not create RPC client for endpoint" // Debug in ../node/pkg/morph/client/constructor.go
FrostFSIRCreatedRPCClientForEndpoint = "created RPC client for endpoint" // Info in ../node/pkg/morph/client/constructor.go
FrostFSIRReloadExtraWallets = "reload extra wallets" // Info in ../node/cmd/frostfs-ir/config.go
Do we need this message if wallets haven't changed?
That was done in the same manner as it done for pprof and metrics. Should we revise this?
@ -13,6 +13,8 @@ import (
const emitMethod = "emit"
func (ap *Processor) processEmit() {
ap.mtx.RLock()
We need the mutex only to access
parsedWallets
field, can we reduce it's scope?Blocking SIGHUP processing because of some network errors or timeouts is undesireable.
I am now wondering why do we need
extraLen
intransferGasToExtraNodes
, we still accessap.parsedWallets
, could just provide a slice, so we have a single read at line 57.I used a mutex because I didn't want to reorganize existing code. I see that it is possible to make "processEmit" a little more understandable and avoid using a mutex. Will do that.
@ -53,6 +54,7 @@ type (
morphClient morphClient
irList Indexer
storageEmission uint64
mtx *sync.RWMutex
Could you mention in comment, what does this mutex protect?
Removed mutex usage, please review.
8452d7935b
to579340f2af
579340f2af
tod43eefbd73
@ -96,2 +97,2 @@
if extraLen != 0 {
err := ap.morphClient.BatchTransferGas(ap.parsedWallets, gasPerNode)
func (ap *Processor) transferGasToExtraNodes(pw []util.Uint160, gasPerNode fixedn.Fixed8) {
if len(pw) != 0 {
I know that the length cannot be
< 0
but let it belen(pw) > 0
:)d43eefbd73
tof62e1f42e4
f62e1f42e4
toc3365270e5
@ -53,3 +54,3 @@
nmNodes := networkMap.Nodes()
nmLen := len(nmNodes)
extraLen := len(ap.parsedWallets)
pw := ap.parsedWallets
Why is there no mutex taken? It seems
processEmit
can be called concurrently.Previously, mutex used to protect the whole calculation and sending gas to extra wallets. We had a decision to avoid doing something related to network under the mutex. What the reason to protect the change of pointer on array?
Now I know more about slices in GO :) I'll add mutex.
Mutex added, please review.
c3365270e5
tof114708d0f
f114708d0f
to274c4be222