Retention policy is not working

3648h = 152days, now - 152 is 9th May, so what is 2nd of May data doing in my database???

Output of the 10th of October:

use collections;
Using database collections
precision rfc3339
select * from interface_tx order by time asc limit 5
name: interface_tx
time host instance type value


2019-05-02T00:00:01.484483146Z c03 tun1 if_packets 9534649
2019-05-02T00:00:01.484490055Z c03 tun1 if_octets 3181992971
2019-05-02T00:00:01.484495104Z c03 tun1 if_errors 36709
2019-05-02T00:00:01.484500411Z c03 tun1 if_dropped 0
2019-05-02T00:00:01.484626996Z c03 eth4.601 if_packets 1554831584

Output of the 3th of October:
[@ ~]# influx
Connected to http://localhost:8086 version 1.7.6
InfluxDB shell version: 1.7.8

use collections;
Using database collections
precision rfc3339
select * from interface_tx order by time asc limit 5
name: interface_tx
time host instance type value


2019-05-02T00:00:01.484483146Z c03 tun1 if_packets 9534649
2019-05-02T00:00:01.484490055Z c03 tun1 if_octets 3181992971
2019-05-02T00:00:01.484495104Z c03 tun1 if_errors 36709
2019-05-02T00:00:01.484500411Z c03 tun1 if_dropped 0
2019-05-02T00:00:01.484626996Z c03 eth4.601 if_packets 1554831584

SHOW RETENTION POLICIES ON collections
name duration shardGroupDuration replicaN default


autogen 3648h0m0s 168h0m0s 1 true

[@~]# date -d “-152 days”
Sat May 4 21:50:29 CEST 2019

Pffff it is working now, was this update 1.7.9-1.x86_64? Nice for the notification

Your retention policy is working as expected. The reason that you saw data from May 2 is that your shard group duration is set to 168 hours, or 7 days. From the documentation:

When InfluxDB enforces an RP it drops entire shard groups, not individual data points, even if the points are older than the RP duration. A shard group will only be removed once a shard group’s duration end time is older than the RP duration.

You might find the documentation about retention policy management and shard group duration management useful.