Influxdb not writing data if RP is specified

I’m trying to save some data in an influxdb measurement with a specific RP but for some reason the data is not being saved. I’ve been trying to figure this out for several days and I’m almost certain it’s a bug (I also opened an issue on github)

To reproduce my issue, create a database and create a non-default retention policy on it:

create database stocks
CREATE RETENTION POLICY "trades_policy" ON main DURATION 30d REPLICATION 1

Then try to add data using the API:

curl -i -XPOST 'http://localhost:8086/write?db=stocks&rp=trades_policy' --data-binary 'raw,host=server01,region=us-west value=0.64'

Now if you check measurement raw you wont find any data inserted in it and no errors are logged whatsoever.

I tried to change the name of the rp in the query to a rp that doesn’t exist and it raised an error however no errors are raised if the rp name is correct.

I also tried to remove the RP param altogether and it worked. There’s something wrong with that influx does internally with the RP. I also tried the influx python driver and tried to do the above query using the library and the same thing happened.

I also checked to make sure that the RPs aren’t quickly deleting the data after its being inserted and therefore leading me to believe that the data isn’t being inserted, however that isn’t the case either. The RP I have has a duration of 72 hours.

Shouldn’t the name of the database you create the RP on be the same as the the DB you’re writing to?

So
CREATE RETENTION POLICY "trades_policy" ON "stocks" DURATION 30d REPLICATION 1

Which version are you using? I’m using 1.5.2 and RP’s work as intended for writing raw and down sampled data

Here it also works as intended …
maybe you didn’t specify the retention policy in the select clause ?

> use stocks
Using database stocks
> show measurements
name: measurements
name
----
raw
> select * from raw
>
> select * from trades_policy.raw
name: raw
time                host     region  value
----                ----     ------  -----
1558453429788315710 server01 us-west 0.64
1 Like

Sorry that was a typo. It should be stocks on both. I tried on v1.7 and 1.6 and it’s not working on both

Oh man that was really stupid of me. I forgot the retention policy in the select.

Thanks