This is similar to https://github.com/cortexproject/cortex/pull/3015, but for chunks-based ingester.