influxdata / influxdata/influxdb

Dropping a default retention policy does not clear the default retention policy

Open
#7,144 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1.x area/meta service
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

### Bug report

**System info:** InfluxDB 1.0.0-beta3

**Steps to reproduce:**

```
> CREATE DATABASE mydb
> SHOW RETENTION POLICIES mydb2
name duration shardGroupDuration replicaN default
autogen 0 168h0m0s 1 true

> DROP RETENTION POLICY autogen ON mydb
> SHOW RETENTION POLICIES ON mydb
name duration shardGroupDuration replicaN default

> CREATE RETENTION POLICY autogen ON mydb DURATION 0s REPLICATION 1
> SHOW RETENTION POLICIES mydb2
name duration shardGroupDuration replicaN default
autogen 0 168h0m0s 1 true

```

**Expected behavior:** The second create retention policy should not have been set as the default since the default was dropped. The second create retention policy command did not ask for the retention policy to be set as the default.

**Actual behavior:** The default database was never cleared so recreating the database had it automatically set as the default.

**Additional info:**

```
[meta]
retention-autocreate = true
```

This is the default, but this example won't work if that is set to false.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the reported CREATE, DROP, and SHOW RETENTION POLICY commands to reproduce the behavior. Trace how dropping a retention policy records or clears the database default, then verify that recreating the policy without requesting a default does not mark it as default.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.