[#325] node: Introduce unsafe_disable param to disable policer #383

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:feature/325-policer_off into master 2023-05-31 10:09:06 +00:00
3 changed files with 13 additions and 1 deletions

View file

@ -25,3 +25,9 @@ func HeadTimeout(c *config.Config) time.Duration {
return HeadTimeoutDefault return HeadTimeoutDefault
} }
// UnsafeDisable returns the value of "unsafe_disable" config parameter
// from "policer" section.
func UnsafeDisable(c *config.Config) bool {
return config.BoolSafe(c.Sub(subsection), "unsafe_disable")
}

View file

@ -204,6 +204,11 @@ func initObjectService(c *cfg) {
} }
func addPolicer(c *cfg, keyStorage *util.KeyStorage, clientConstructor *cache.ClientCache) { func addPolicer(c *cfg, keyStorage *util.KeyStorage, clientConstructor *cache.ClientCache) {
if policerconfig.UnsafeDisable(c.appCfg) {
c.log.Warn(logs.FrostFSNodePolicerIsDisabled)
return
}
ls := c.cfgObject.cfgLocalStorage.localStorage ls := c.cfgObject.cfgLocalStorage.localStorage
pol := policer.New( pol := policer.New(

View file

@ -477,7 +477,8 @@ const (
FrostFSNodeRemovingAllTreesForContainer = "removing all trees for container" // Debug in ../node/cmd/frostfs-node/tree.go FrostFSNodeRemovingAllTreesForContainer = "removing all trees for container" // Debug in ../node/cmd/frostfs-node/tree.go
FrostFSNodeContainerRemovalEventReceivedButTreesWerentRemoved = "container removal event received, but trees weren't removed" // Error in ../node/cmd/frostfs-node/tree.go FrostFSNodeContainerRemovalEventReceivedButTreesWerentRemoved = "container removal event received, but trees weren't removed" // Error in ../node/cmd/frostfs-node/tree.go
FrostFSNodeCantListenGRPCEndpointControl = "can't listen gRPC endpoint (control)" // Error in ../node/cmd/frostfs-node/control.go FrostFSNodeCantListenGRPCEndpointControl = "can't listen gRPC endpoint (control)" // Error in ../node/cmd/frostfs-node/control.go
CommonApplicationStarted = "application started" // Info in ../node/cmd/frostfs-ir/main.go FrostFSNodePolicerIsDisabled = "policer is disabled"
CommonApplicationStarted = "application started"
ShardGCCollectingExpiredObjectsStarted = "collecting expired objects started" ShardGCCollectingExpiredObjectsStarted = "collecting expired objects started"
ShardGCCollectingExpiredObjectsCompleted = "collecting expired objects completed" ShardGCCollectingExpiredObjectsCompleted = "collecting expired objects completed"
ShardGCCollectingExpiredLocksStarted = "collecting expired locks started" ShardGCCollectingExpiredLocksStarted = "collecting expired locks started"