Describe the bug
Observed this issue on replica shards where the segment_N file is not getting removed even after the commits (flushes).
To Reproduce
Create index with segment replication using remote store replication. Index docs, refresh, & then flush. On the primary, the segment_N+1 would appear and segment_N would be deleted, but on replica both segment_N and segment_N+1 file shows up. If you repeat the (Index docs, refresh, & then flush), then more and more segment_N files shows up on replica.
Expected behavior
There should be only 1 segment_N file in steady state.
Plugins
Standard
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.