Need understanding on Multiple Retention Policies

Hi Team,
I have a small doubt understanding the Retention Policies and Shard group Duration. Does both RP and Shard Group duration are inter related to each other.for example:

Case 1: If i create a RP of 7 days and shard group duration of 1hr
---- In the above scenario the data will stay up to 7 days but the shards will get created of 1 hr data and at end it will be 24*7=168 shard files get created always and once it reached 7 days older the shards will be get removed. Let me know if my understanding is correct or not.

Case 2: If I create a RP of 7 days and shard group duration of 1d
– similar to above one it will keep 10 days of data but end it will keep the shard file of 1d of data and at the end shard group have only 10 shards and older than 10 days get dropped from the database. Let me know if i understand correctly.

Case 3: As in the above 2 case, RP got created with 2 different name ,my question is which one is take into consideration. As A single measurement can belong to several retention policies and 2 person runs 2 different queries pointing to same measurement with different RP, does both users will see the same data even one RP is 7d and other is 10d.Which one takes into consideration?

Please help

Hello @oom,

If you create a retention policy of 7 days with a shard duration of 1 d then you will only keep 7 days of data at any point. So you will keep 7 shards at any point in time. So your understanding as described in case 1 is correct.

I think this thread might be helpful:

Thanks for your reply. One more clarification on RP.

As the Autogen RP is of 7days of data and after that it drop the corresponding shards, what if I want to keep Infinite RP for a measurement on a requirement. How to setup INF RP which will not be get removed from the database.

Got the answer from the documentation