# \[InfluxDB v2.7.1\] Why the bucket retention period do not working?

**URL:** <https://community.influxdata.com/t/influxdb-v2-7-1-why-the-bucket-retention-period-do-not-working/33718>\
**Category:** InfluxDB 2\
**Tags:** influxdb\
**Created:** [March 27, 2024, 10:03am UTC](https://community.influxdata.com/t/influxdb-v2-7-1-why-the-bucket-retention-period-do-not-working/33718 "2024-03-27T10:03:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [March 27, 2024, 5:30pm UTC](https://community.influxdata.com/t/influxdb-v2-7-1-why-the-bucket-retention-period-do-not-working/33718/2 "2024-03-27T17:30:48Z")

</div>

@lzl82891314 There’s a lot of variables that play into when data actually gets deleted and it gets a little more complicated when you change the retention period of a bucket. Essentially it boils down to InfluxDB v2 expiring shard groups and not specific points. A shard group will only get expired when _all_ the points in the group have expired. I’m guessing the old data points are stored in a shard group that was created before you changed the retention period and data in the shard group hasn’t fully expired.

For the nitty-gritty details, here’s some docs:

- [Data retention in InfluxDB | InfluxDB OSS v2 Documentation](https://docs.influxdata.com/influxdb/v2/reference/internals/data-retention/)
- [InfluxDB shards and shard groups | InfluxDB OSS v2 Documentation](https://docs.influxdata.com/influxdb/v2/reference/internals/shards/)

---

_[View the full topic](https://community.influxdata.com/t/influxdb-v2-7-1-why-the-bucket-retention-period-do-not-working/33718)._
