-
Notifications
You must be signed in to change notification settings - Fork 818
Distributor default sharding should support default 0 value. #5759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributor default sharding should support default 0 value. #5759
Conversation
Signed-off-by: Ryan West <[email protected]>
Signed-off-by: Ryan West <[email protected]>
pkg/distributor/distributor.go
Outdated
@@ -178,10 +178,14 @@ func (cfg *Config) Validate(limits validation.Limits) error { | |||
return errInvalidShardingStrategy | |||
} | |||
|
|||
if cfg.ShardingStrategy == util.ShardingStrategyShuffle && limits.IngestionTenantShardSize <= 0 { | |||
if limits.IngestionTenantShardSize < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if cfg.ShardingStrategy == util.ShardingStrategyShuffle && limits.IngestionTenantShardSize < 0 {
}
I think it is fine to have IngestionTenantShardSize < 0
when strategy is not shuffle sharding as it is a noop.
…g code back to L680 Signed-off-by: Ryan West <[email protected]>
@@ -178,7 +178,7 @@ func (cfg *Config) Validate(limits validation.Limits) error { | |||
return errInvalidShardingStrategy | |||
} | |||
|
|||
if cfg.ShardingStrategy == util.ShardingStrategyShuffle && limits.IngestionTenantShardSize <= 0 { | |||
if cfg.ShardingStrategy == util.ShardingStrategyShuffle && limits.IngestionTenantShardSize < 0 { | |||
return errInvalidTenantShardSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you update the error message invalid tenant shard size, the value must be greater than 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good call.
Signed-off-by: Ryan West <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There is a discrepancy between the current behavior of the system and the documented functionality regarding the setting of the ingestion_tenant_shard_size parameter.
Current Behavior
When attempting to set the -distributor.ingestion-tenant-shard-size flag to 0, the system throws an error.
Expected Behavior (As Per Documentation)
The documentation states the following:
According to this, setting the value to 0 should be supported and is intended to disable shuffle sharding for the tenant.
Rationale for Setting the Value to 0
The intention behind setting the ingestion_tenant_shard_size to 0 by default is to enable shuffle-sharding, while also allowing a tenant to utilize the entire ring as the shard size. This setup is crucial for overwriting settings for specific tenants who might require shuffle sharding. The issue was identified during an attempt to configure our ingesters with the zero value.
What this PR does:
This PR addresses the exception that is thrown, warns a customer when the combination of shuffle sharding enabled and ingestion_tenant_shard_size == 0. Also addressing the
Push()
function to check and update the ring topology accordingly.Which issue(s) this PR fixes:
Fixes #5189
Related: #5250
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]