[#1639] config/object: Remove pool settings for Put operation
Removed `object.put.remote_pool_size` and `object.put.local_pool_size` settings. Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
1db6abb745
commit
c8210ca43b
7 changed files with 1 additions and 63 deletions
|
@ -664,10 +664,6 @@ type cfgAccessPolicyEngine struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type cfgObjectRoutines struct {
|
type cfgObjectRoutines struct {
|
||||||
putRemote *ants.Pool
|
|
||||||
|
|
||||||
putLocal *ants.Pool
|
|
||||||
|
|
||||||
replication *ants.Pool
|
replication *ants.Pool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1166,16 +1162,6 @@ func initAccessPolicyEngine(ctx context.Context, c *cfg) {
|
||||||
func initObjectPool(cfg *config.Config) (pool cfgObjectRoutines) {
|
func initObjectPool(cfg *config.Config) (pool cfgObjectRoutines) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
optNonBlocking := ants.WithNonblocking(true)
|
|
||||||
|
|
||||||
putRemoteCapacity := objectconfig.Put(cfg).PoolSizeRemote()
|
|
||||||
pool.putRemote, err = ants.NewPool(putRemoteCapacity, optNonBlocking)
|
|
||||||
fatalOnErr(err)
|
|
||||||
|
|
||||||
putLocalCapacity := objectconfig.Put(cfg).PoolSizeLocal()
|
|
||||||
pool.putLocal, err = ants.NewPool(putLocalCapacity, optNonBlocking)
|
|
||||||
fatalOnErr(err)
|
|
||||||
|
|
||||||
replicatorPoolSize := replicatorconfig.PoolSize(cfg)
|
replicatorPoolSize := replicatorconfig.PoolSize(cfg)
|
||||||
pool.replication, err = ants.NewPool(replicatorPoolSize)
|
pool.replication, err = ants.NewPool(replicatorPoolSize)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
@ -1410,13 +1396,7 @@ func (c *cfg) getComponents(ctx context.Context, logPrm *logger.Prm) []dCmp {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cfg) reloadPools() error {
|
func (c *cfg) reloadPools() error {
|
||||||
newSize := objectconfig.Put(c.appCfg).PoolSizeLocal()
|
newSize := replicatorconfig.PoolSize(c.appCfg)
|
||||||
c.reloadPool(c.cfgObject.pool.putLocal, newSize, "object.put.local_pool_size")
|
|
||||||
|
|
||||||
newSize = objectconfig.Put(c.appCfg).PoolSizeRemote()
|
|
||||||
c.reloadPool(c.cfgObject.pool.putRemote, newSize, "object.put.remote_pool_size")
|
|
||||||
|
|
||||||
newSize = replicatorconfig.PoolSize(c.appCfg)
|
|
||||||
c.reloadPool(c.cfgObject.pool.replication, newSize, "replicator.pool_size")
|
c.reloadPool(c.cfgObject.pool.replication, newSize, "replicator.pool_size")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -21,10 +21,6 @@ const (
|
||||||
|
|
||||||
putSubsection = "put"
|
putSubsection = "put"
|
||||||
getSubsection = "get"
|
getSubsection = "get"
|
||||||
|
|
||||||
// PutPoolSizeDefault is a default value of routine pool size to
|
|
||||||
// process object.Put requests in object service.
|
|
||||||
PutPoolSizeDefault = 10
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Put returns structure that provides access to "put" subsection of
|
// Put returns structure that provides access to "put" subsection of
|
||||||
|
@ -35,30 +31,6 @@ func Put(c *config.Config) PutConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PoolSizeRemote returns the value of "remote_pool_size" config parameter.
|
|
||||||
//
|
|
||||||
// Returns PutPoolSizeDefault if the value is not a positive number.
|
|
||||||
func (g PutConfig) PoolSizeRemote() int {
|
|
||||||
v := config.Int(g.cfg, "remote_pool_size")
|
|
||||||
if v > 0 {
|
|
||||||
return int(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
return PutPoolSizeDefault
|
|
||||||
}
|
|
||||||
|
|
||||||
// PoolSizeLocal returns the value of "local_pool_size" config parameter.
|
|
||||||
//
|
|
||||||
// Returns PutPoolSizeDefault if the value is not a positive number.
|
|
||||||
func (g PutConfig) PoolSizeLocal() int {
|
|
||||||
v := config.Int(g.cfg, "local_pool_size")
|
|
||||||
if v > 0 {
|
|
||||||
return int(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
return PutPoolSizeDefault
|
|
||||||
}
|
|
||||||
|
|
||||||
// SkipSessionTokenIssuerVerification returns the value of "skip_session_token_issuer_verification" config parameter or `false“ if is not defined.
|
// SkipSessionTokenIssuerVerification returns the value of "skip_session_token_issuer_verification" config parameter or `false“ if is not defined.
|
||||||
func (g PutConfig) SkipSessionTokenIssuerVerification() bool {
|
func (g PutConfig) SkipSessionTokenIssuerVerification() bool {
|
||||||
return config.BoolSafe(g.cfg, "skip_session_token_issuer_verification")
|
return config.BoolSafe(g.cfg, "skip_session_token_issuer_verification")
|
||||||
|
|
|
@ -13,8 +13,6 @@ func TestObjectSection(t *testing.T) {
|
||||||
t.Run("defaults", func(t *testing.T) {
|
t.Run("defaults", func(t *testing.T) {
|
||||||
empty := configtest.EmptyConfig()
|
empty := configtest.EmptyConfig()
|
||||||
|
|
||||||
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeRemote())
|
|
||||||
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeLocal())
|
|
||||||
require.EqualValues(t, objectconfig.DefaultTombstoneLifetime, objectconfig.TombstoneLifetime(empty))
|
require.EqualValues(t, objectconfig.DefaultTombstoneLifetime, objectconfig.TombstoneLifetime(empty))
|
||||||
require.False(t, objectconfig.Put(empty).SkipSessionTokenIssuerVerification())
|
require.False(t, objectconfig.Put(empty).SkipSessionTokenIssuerVerification())
|
||||||
})
|
})
|
||||||
|
@ -22,8 +20,6 @@ func TestObjectSection(t *testing.T) {
|
||||||
const path = "../../../../config/example/node"
|
const path = "../../../../config/example/node"
|
||||||
|
|
||||||
fileConfigTest := func(c *config.Config) {
|
fileConfigTest := func(c *config.Config) {
|
||||||
require.Equal(t, 100, objectconfig.Put(c).PoolSizeRemote())
|
|
||||||
require.Equal(t, 200, objectconfig.Put(c).PoolSizeLocal())
|
|
||||||
require.EqualValues(t, 10, objectconfig.TombstoneLifetime(c))
|
require.EqualValues(t, 10, objectconfig.TombstoneLifetime(c))
|
||||||
require.True(t, objectconfig.Put(c).SkipSessionTokenIssuerVerification())
|
require.True(t, objectconfig.Put(c).SkipSessionTokenIssuerVerification())
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,8 +87,6 @@ FROSTFS_REPLICATOR_POOL_SIZE=10
|
||||||
FROSTFS_CONTAINER_LIST_STREAM_BATCH_SIZE=500
|
FROSTFS_CONTAINER_LIST_STREAM_BATCH_SIZE=500
|
||||||
|
|
||||||
# Object service section
|
# Object service section
|
||||||
FROSTFS_OBJECT_PUT_REMOTE_POOL_SIZE=100
|
|
||||||
FROSTFS_OBJECT_PUT_LOCAL_POOL_SIZE=200
|
|
||||||
FROSTFS_OBJECT_PUT_SKIP_SESSION_TOKEN_ISSUER_VERIFICATION=true
|
FROSTFS_OBJECT_PUT_SKIP_SESSION_TOKEN_ISSUER_VERIFICATION=true
|
||||||
FROSTFS_OBJECT_DELETE_TOMBSTONE_LIFETIME=10
|
FROSTFS_OBJECT_DELETE_TOMBSTONE_LIFETIME=10
|
||||||
FROSTFS_OBJECT_GET_PRIORITY="$attribute:ClusterName $attribute:UN-LOCODE"
|
FROSTFS_OBJECT_GET_PRIORITY="$attribute:ClusterName $attribute:UN-LOCODE"
|
||||||
|
|
|
@ -134,8 +134,6 @@
|
||||||
"tombstone_lifetime": 10
|
"tombstone_lifetime": 10
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"remote_pool_size": 100,
|
|
||||||
"local_pool_size": 200,
|
|
||||||
"skip_session_token_issuer_verification": true
|
"skip_session_token_issuer_verification": true
|
||||||
},
|
},
|
||||||
"get": {
|
"get": {
|
||||||
|
|
|
@ -117,8 +117,6 @@ object:
|
||||||
delete:
|
delete:
|
||||||
tombstone_lifetime: 10 # tombstone "local" lifetime in epochs
|
tombstone_lifetime: 10 # tombstone "local" lifetime in epochs
|
||||||
put:
|
put:
|
||||||
remote_pool_size: 100 # number of async workers for remote PUT operations
|
|
||||||
local_pool_size: 200 # number of async workers for local PUT operations
|
|
||||||
skip_session_token_issuer_verification: true # session token issuer verification will be skipped if true
|
skip_session_token_issuer_verification: true # session token issuer verification will be skipped if true
|
||||||
get:
|
get:
|
||||||
priority: # list of metrics of nodes for prioritization
|
priority: # list of metrics of nodes for prioritization
|
||||||
|
|
|
@ -406,8 +406,6 @@ Contains object-service related parameters.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
object:
|
object:
|
||||||
put:
|
|
||||||
remote_pool_size: 100
|
|
||||||
get:
|
get:
|
||||||
priority:
|
priority:
|
||||||
- $attribute:ClusterName
|
- $attribute:ClusterName
|
||||||
|
@ -416,8 +414,6 @@ object:
|
||||||
| Parameter | Type | Default value | Description |
|
| Parameter | Type | Default value | Description |
|
||||||
|-----------------------------|------------|---------------|------------------------------------------------------------------------------------------------|
|
|-----------------------------|------------|---------------|------------------------------------------------------------------------------------------------|
|
||||||
| `delete.tombstone_lifetime` | `int` | `5` | Tombstone lifetime for removed objects in epochs. |
|
| `delete.tombstone_lifetime` | `int` | `5` | Tombstone lifetime for removed objects in epochs. |
|
||||||
| `put.remote_pool_size` | `int` | `10` | Max pool size for performing remote `PUT` operations. Used by Policer and Replicator services. |
|
|
||||||
| `put.local_pool_size` | `int` | `10` | Max pool size for performing local `PUT` operations. Used by Policer and Replicator services. |
|
|
||||||
| `get.priority` | `[]string` | | List of metrics of nodes for prioritization. Used for computing response on GET requests. |
|
| `get.priority` | `[]string` | | List of metrics of nodes for prioritization. Used for computing response on GET requests. |
|
||||||
|
|
||||||
# `runtime` section
|
# `runtime` section
|
||||||
|
|
Loading…
Add table
Reference in a new issue