Drop retention policy before creating it #2051
Conversation
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Why don't we need the same for |
Looks like here begins a discrepancy with docker :)
|
Signed-off-by: Michael Pankov <work@michaelpankov.com>
@ip1981 fixed the docker. We don't need it for |
I don't see it failing. What do I do wrong?
|
I don't know, for me it looked like this
|
Oh, I get it. Somehow |
So, you can't create a policy with different duration. |
One concern remains:
It looks like the data might be lost accidentally. |
Isn't it the same with |
We drop the queries, but not the data they produce, AFAIK:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs more investigation / clarification.
According to the influx docs (https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/#create-retention-policies-with-create-retention-policy)
A successful CREATE RETENTION POLICY query returns an empty response. If you attempt to create a retention policy identical to one that already exists, InfluxDB does not return an error. If you attempt to create a retention policy with the same name as an existing retention policy but with differing attributes, InfluxDB returns an error.
I think we need |
@jgrund I think we want to allow the attributes to be different. In my case it's probably because I was testing tunable retention policy locally, but I'd say this is useful overall. |
Ok I'll try to determine if it's already present, and |
What happens to existing data when a RP is altered? |
Seems existing data is intact after altering RP
|
I guess that's the point why ALTER exist. Meanwhile continuos queries cannot be altered, only dropped. |
Ok, so we should move this patch to use alter on create failure due to existing RP then |
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
|
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
* Drop retention policy before creating it Signed-off-by: Michael Pankov <work@michaelpankov.com> * Do the same for docker Signed-off-by: Michael Pankov <work@michaelpankov.com> * Alter on error Signed-off-by: Michael Pankov <work@michaelpankov.com> * Remove extra format Signed-off-by: Michael Pankov <work@michaelpankov.com> * Don't compare error message Signed-off-by: Michael Pankov <work@michaelpankov.com> * Fix second script Signed-off-by: Michael Pankov <work@michaelpankov.com>
Otherwise it fails to setup Influx if it's already setup
Signed-off-by: Michael Pankov work@michaelpankov.com
This change is