influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.66k stars 3.54k forks source link

2.4: Changing bucket expiration to "never" in the UI has no effect #23764

Open andig opened 1 year ago

andig commented 1 year ago

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

  1. Chose bucket with expiration (say 30d) in the UI
  2. Change expiration to "never"
  3. Save

Expected behavior:

List of buckets shows expiration "never"

Actual behavior:

Bucket still shows "30d". After reloading the GUI it remains at 30d.

Environment info:

InfluxDB 2.0.9 Server: d1233b7 Frontend: 9c89e22

Details

This is the UI's XHR request:

{"id":"107d309886153948","orgID":"5d4718f7355f8f75","type":"user","name":"api","retentionRules":[],"createdAt":"2022-09-20T18:56:23.322209526Z","updatedAt":"2022-09-28T06:06:52.371527624Z","links":{"labels":"/api/v2/buckets/107d309886153948/labels","members":"/api/v2/buckets/107d309886153948/members","org":"/api/v2/orgs/5d4718f7355f8f75","owners":"/api/v2/buckets/107d309886153948/owners","self":"/api/v2/buckets/107d309886153948","write":"/api/v2/write?org=5d4718f7355f8f75&bucket=107d309886153948"},"labels":[]}

This is the server response:

{
    "id": "107d309886153948",
    "orgID": "5d4718f7355f8f75",
    "type": "user",
    "name": "api",
    "retentionRules": [
        {
            "type": "expire",
            "everySeconds": 2592000,
            "shardGroupDurationSeconds": 86400
        }
    ],
    "createdAt": "2022-09-20T18:56:23.322209526Z",
    "updatedAt": "2022-09-28T06:12:37.49901153Z",
    "links": {
        "labels": "/api/v2/buckets/107d309886153948/labels",
        "members": "/api/v2/buckets/107d309886153948/members",
        "org": "/api/v2/orgs/5d4718f7355f8f75",
        "owners": "/api/v2/buckets/107d309886153948/owners",
        "self": "/api/v2/buckets/107d309886153948",
        "write": "/api/v2/write?org=5d4718f7355f8f75\u0026bucket=107d309886153948"
    },
    "labels": []
}

Seems as if the API is ignoring the empty retention rules in the PATCH?

andig commented 1 year ago

This is still a problem in 2.4 OSS

andig commented 1 year ago

Docs at https://docs.influxdata.com/influxdb/v2.4/organizations/buckets/update-bucket/ don't explain how retention period can be removed.

andig commented 1 year ago

Any feedback? Seems to be an obvious bug?

jeffreyssmith2nd commented 1 year ago

Confirmed issue with the UI. Retention policies can be set to never expire by using the influx bucket update command and setting --retention 0.

andig commented 1 year ago

@jeffreyssmith2nd for sake of completeness: could you add docs how to do this via api?

jeffreyssmith2nd commented 1 year ago

The equivalent API call is documented here: https://docs.influxdata.com/influxdb/v2.4/api/#operation/PatchBucketsID

andig commented 1 year ago

It would be nice if https://docs.influxdata.com/influxdb/v2.4/organizations/buckets/update-bucket/ could cover how to remove expiry, too.

BetaAthe commented 4 months ago

Year and a half later and still have the same bug?