diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java index 1daac295630ff..49263e92e5457 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -915,6 +915,7 @@ public void testScrollCreatedOnReplica() throws Exception { final IndexShard replicaShard = getIndexShard(replica, INDEX_NAME); final SegmentInfos segmentInfos = replicaShard.getLatestSegmentInfosAndCheckpoint().v1().get(); final Collection snapshottedSegments = segmentInfos.files(false); + logger.info("snapshotted segments: " + snapshottedSegments); // opens a scrolled query before a flush is called. // this is for testing scroll segment consistency between refresh and flush SearchResponse searchResponse = client(replica).prepareSearch() @@ -960,14 +961,17 @@ public void testScrollCreatedOnReplica() throws Exception { scrollHits += searchResponse.getHits().getHits().length; searchResponse = client(replica).prepareSearchScroll(searchResponse.getScrollId()).setScroll(TimeValue.timeValueDays(1)).get(); assertAllSuccessful(searchResponse); + logger.info("scrollHits: " + scrollHits + ". scroll id: " + searchResponse.getScrollId()); } while (searchResponse.getHits().getHits().length > 0); List currentFiles = List.of(replicaShard.store().directory().listAll()); + logger.info("currentFiles: " + currentFiles); assertTrue("Files should be preserved", currentFiles.containsAll(snapshottedSegments)); client(replica).prepareClearScroll().addScrollId(searchResponse.getScrollId()).get(); currentFiles = List.of(replicaShard.store().directory().listAll()); + logger.info("currentFiles after clearing scroll: " + currentFiles); assertFalse("Files should be cleaned up post scroll clear request", currentFiles.containsAll(snapshottedSegments)); assertEquals(100, scrollHits); }