influxdata / influxdata/influxdb

Retention values that are "too big" overflow and cause confusing error messages

Open
#21,735 0 comments 0 reactions 0 assignees View on GitHub
area/2.x area/api area/api-docs area/HTTP
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__

1. Attempt to create a bucket with retention.EverySeconds = 999999

__Expected behavior:__
Either the request succeeds, or a helpful error explaining the problem is returned

__Actual behavior:__
```
internal error: retention policy duration must be at least 1h0m0s
```
Debugging showed me that the retention value is overflowing in [this logic](https://github.com/influxdata/influxdb/blob/master/tenant/http_server_bucket.go#L365-L369).

The same bug is also present on bucket-update requests. See the original community report [here](https://community.influxdata.com/t/expiration-seconds-error-occurs-when-new-retention-time-is-99999-days/20464).

Contributor guide

Open the contributing guide

Research direction

Start in tenant/http_server_bucket.go around lines 365-369 and reproduce the overflow with retention.EverySeconds set to 999999. Check both bucket creation and update requests, then verify that the request succeeds or returns a helpful error instead of the confusing minimum-duration message.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.