Two commands return different segments info of the same index

ES 7.7.1, jdk 14.
A cluster with 3 dedicated master nodes and 100+ data nodes.
During the execution of the forcemerge, myindex/_stats and _cat/segments/myindex return different segments info.
Here is the forcemerge cmd, the ysearch6_5 is about 4GB with 1 primary shard and 0 replica before the cmd is executed.

POST ysearch6_5/_forcemerge?max_num_segments=1

Before the _forcemerge is done, ysearch6_5/_stats and _cat/segments/ysearch6_5 return different numbers of the segment count.

As we can see above, stats returns 2 segments of the index while _cat/segments shows about 15+ segments of the index.
I believe the _cat/segment cmd is much more precise. But why this happens? Is it as expected or just a bug?

And here is another question:
What happens if I set replica to 6 during the execution of the forcemerge? What segment files will be sent to the replica nodes?

_stats shows the number of the searchable segments while _cat/segments shows all.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.