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

[0.11] CREATE RETENTION POLICY and CREATE CONTINUOUS QUERY are not idempotent #6094

Closed
rkuchan opened this issue Mar 22, 2016 · 0 comments
Closed

Comments

@rkuchan
Copy link
Contributor

rkuchan commented Mar 22, 2016

  • CREATE RP doesn't give an error if I create the exact same RP or if I create an RP with the same name but with a different DURATION:
> create retention policy blah on telegraf duration 1d replication 1
> show retention policies on telegraf
name       duration    replicaN    default
default    0           1           true
blah       24h0m0s     1           false

> create retention policy blah on telegraf duration 1d replication 1
> create retention policy blah on telegraf duration 2d replication 1
> show retention policies on telegraf
name       duration    replicaN    default
default    0           1           true
blah       24h0m0s     1           false
  • CREATE CQ gives an error if I create the exact same CQ and if I create a CQ with the same name but with a different GROUP BY time interval:
> create continuous query new on telegraf begin select mean(usage_idle) into new from cpu group by time(5m) end
> show continuous queries
name: _internal
---------------
name    query


name: new
---------
name    query


name: telegraf
--------------
name    query
new     CREATE CONTINUOUS QUERY new ON telegraf BEGIN SELECT mean(usage_idle) INTO telegraf."default".new FROM telegraf."default".cpu GROUP BY time(5m) END

> create continuous query new on telegraf begin select mean(usage_idle) into new from cpu group by time(5m) end
ERR: continuous query already exists
> create continuous query new on telegraf begin select mean(usage_idle) into new from cpu group by time(6m) end
ERR: continuous query already exists
  • CREATE USER doesn't give an error if I create the same user with the same password but does give an error if I create the same user with a different password:
> create user regan with password 'regan' with all privileges
> create user regan with password 'regan' with all privileges
> create user regan with password 'blueberries' with all privileges
ERR: user already exists
> show users
user    admin
regan   true
@e-dard e-dard changed the title [0.11] CREATE RP, CREATE CQ, and CREATE USER handle duplicates differently [0.11] CREATE RETENTION POLICY and CREATE CONTINUOUS QUERY are not correctly idempotent Mar 23, 2016
@e-dard e-dard changed the title [0.11] CREATE RETENTION POLICY and CREATE CONTINUOUS QUERY are not correctly idempotent [0.11] CREATE RETENTION POLICY and CREATE CONTINUOUS QUERY are not idempotent Mar 23, 2016
@e-dard e-dard self-assigned this Mar 23, 2016
@e-dard e-dard added this to the 0.12.0 milestone Mar 23, 2016
e-dard added a commit that referenced this issue Mar 23, 2016
Partially addresses #6094.

Previously, when creating a retention policy only the name was
considered when deciding if the policy already existed. This meant that
adding a second policy with the same name but different duration or
replica factor returned the original policy and no error.

This commit fixes that and ensures that name, duration and replica
factor are all considered.
e-dard added a commit that referenced this issue Mar 23, 2016
Partially fixes #6094.

Prior to this when passing the same query and CQ name in a CREATE
CONTINUOUS QUERY command an error would be returned. This means the
command was not behaving in a similar way to other commands.a

Now when running the command with the same CQ name and query string no
error will be returned. Note, this change does not parse the query, it
simply compares a normalised query string to the existing one on the CQ.
e-dard added a commit that referenced this issue Mar 29, 2016
Partially addresses #6094.

Previously, when creating a retention policy only the name was
considered when deciding if the policy already existed. This meant that
adding a second policy with the same name but different duration or
replica factor returned the original policy and no error.

This commit fixes that and ensures that name, duration and replica
factor are all considered.
@e-dard e-dard closed this as completed in dcb6e31 Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants