Skip to content
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

shard duration 0 (infinite) not applying, Error: retention policy duration must be greater than the shard duration #524

Open
paulheg opened this issue Feb 14, 2024 · 2 comments

Comments

@paulheg
Copy link

paulheg commented Feb 14, 2024

Steps to reproduce:
List the minimal actions needed to reproduce the behaviour.

  1. create influxdb:latest container
  2. try creating a bucket with influx bucket create --name "test" --shard-group-duration 10000w -r 0

Expected behaviour:
Should create the bucket since the retention value is zero -> infinite

Actual behaviour:
Error: failed to create bucket: 500 Internal Server Error: retention policy duration must be greater than the shard duration

Environment info:
INFLUXDB_VERSION: 2.7.3
INFLUX_CLI_VERSION: 2.7.3

@paulheg
Copy link
Author

paulheg commented Feb 14, 2024

just tested it with
INFLUXDB_VERSION 2.7.5
INFLUX_CLI_VERSION 2.7.3,
with no luck

@philjb
Copy link

philjb commented Feb 14, 2024

Hi - this is an issue in the influx-cli tool: https://github.com/influxdata/influx-cli, not influxdb 2.7 itself. The tool does not support creating an infinite duration bucket with an explicit shard group duration, because it is defaulting the retention to 720hrs (30 days) if the retention is zero but a shard group duration is specified.

See this code block:

if rp > 0 || sgd > 0 {
rule := api.NewRetentionRuleWithDefaults()
if rp > 0 {
rule.SetEverySeconds(int64(rp.Round(time.Second) / time.Second))

If you're willing, you can submit a pr to fix it in the tool.

You can create your bucket directly using the api instead of the cli tool: https://docs.influxdata.com/influxdb/v2/admin/buckets/create-bucket/?t=InfluxDB+API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants