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

[1.0-rc1] Alter retention policy does not accept "default" with "shard duration" #7218

Closed
kostasb opened this issue Aug 26, 2016 · 4 comments
Assignees
Labels
area/influxql Issues related to InfluxQL query language kind/bug
Milestone

Comments

@kostasb
Copy link

kostasb commented Aug 26, 2016

ALTER RETENTION POLICY throws a parsing error if shard duration and default co-exist in the statement.

As a result of the combination of this and issue 7150 which describes that the ALTER statement resets shard duration when not explicitly defined, the impact is :

  • two ALTER statements are needed to set a new default RP with custom shard duration (workaround: set all parameters during CREATE RETENTION POLICY)
  • in order to switch the default RP while maintaining a custom shard duration, the ALTER ... default statement needs to go first, followed by ALTER ... shard duration.
    If the statements are given in the opposite order, the custom shard duration will be overwritten.
  • the ALTER statement as documented in 1.0 docs does not work.
InfluxDB shell version: 1.0.0~rc1

> create database mytest

> show retention policies on mytest
name    duration    shardGroupDuration  replicaN    default
autogen 0       168h0m0s        1       true

> use mytest
Using database mytest

> alter retention policy autogen on mytest duration 720h replication 1 shard duration 168h default
ERR: error parsing query: found DEFAULT, expected ; at line 1, char 90

> alter retention policy autogen on mytest duration 720h replication 1 shard duration 168h

> show retention policies on mytest
name    duration    shardGroupDuration  replicaN    default
autogen 720h0m0s    168h0m0s        1       true

> alter retention policy autogen on mytest duration 720h replication 1 default

> show retention policies on mytest
name    duration    shardGroupDuration  replicaN    default
autogen 720h0m0s    24h0m0s         1       true
@jwilder jwilder added area/influxql Issues related to InfluxQL query language kind/bug labels Aug 26, 2016
@jwilder
Copy link
Contributor

jwilder commented Aug 26, 2016

@jsternberg Can you take a look?

@beckettsean
Copy link
Contributor

@rkuchan possible docs change, let's watch this issue

@jsternberg
Copy link
Contributor

This definitely just looks like a parsing error. I'm investigating now.

@jsternberg
Copy link
Contributor

Fixed via #7219.

@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxql Issues related to InfluxQL query language kind/bug
Projects
None yet
Development

No branches or pull requests

5 participants