It appears that adding a one-year retention policy just truncated all my data. Did I goof? If so, how do I not do this next time?!?
Here’s a mildly edited script:
Initially, no retention policy in place:
> show retention policies on aquaviewer
name duration shardGroupDuration replicaN default
autogen 0 168h0m0s 1 true
The first entry is over a year old, the last entry is very recent (2018-06-16T18:58:49.157Z):
> precision rfc3339
> use aquaviewer
Using database aquaviewer
> select first("phValue") from "5x00Reading"
name: 5x00Reading
-----------------
time first
2017-05-29T00:00:01.765Z 8.926681518554688
> select last("phValue") from "5x00Reading"
name: 5x00Reading
-----------------
time last
2018-06-16T18:58:49.157Z 6.224181652069092
Adding a retention policy:
> create retention policy "a_year" on "aquaviewer" duration 52w replication 1 default
But now the oldest entry is only 30 minutes old (!!):
> select first("phValue") from "5x00Reading"
name: 5x00Reading
-----------------
time first
2018-06-16T19:28:53.63Z 6.2368950843811035
> select last("phValue") from "5x00Reading"
name: 5x00Reading
-----------------
time last
2018-06-16T19:38:52.357Z 48.784942626953125
… and there are very few entries:
> select count("phValue") from "5x00Reading"
name: 5x00Reading
-----------------
time count
1970-01-01T00:00:00Z 540