File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
main/java/org/elasticsearch/index/shard
test/java/org/elasticsearch/index/shard Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -947,9 +947,7 @@ public FlushStats flushStats() {
947
947
948
948
public DocsStats docStats () {
949
949
readAllowed ();
950
- DocsStats docsStats = getEngine ().docStats ();
951
- markSearcherAccessed ();
952
- return docsStats ;
950
+ return getEngine ().docStats ();
953
951
}
954
952
955
953
/**
@@ -1028,11 +1026,7 @@ public TranslogStats translogStats() {
1028
1026
public CompletionStats completionStats (String ... fields ) {
1029
1027
readAllowed ();
1030
1028
try {
1031
- CompletionStats stats = getEngine ().completionStats (fields );
1032
- // we don't wait for a pending refreshes here since it's a stats call instead we mark it as accessed only which will cause
1033
- // the next scheduled refresh to go through and refresh the stats as well
1034
- markSearcherAccessed ();
1035
- return stats ;
1029
+ return getEngine ().completionStats (fields );
1036
1030
} catch (IOException e ) {
1037
1031
throw new UncheckedIOException (e );
1038
1032
}
Original file line number Diff line number Diff line change @@ -2763,7 +2763,7 @@ public void testCompletionStatsMarksSearcherAccessed() throws Exception {
2763
2763
});
2764
2764
long prevAccessTime = shard .getLastSearcherAccess ();
2765
2765
indexShard .completionStats ();
2766
- assertThat ("searcher was not marked as accessed" , shard .getLastSearcherAccess (), greaterThan (prevAccessTime ));
2766
+ assertThat ("searcher was marked as accessed" , shard .getLastSearcherAccess (), equalTo (prevAccessTime ));
2767
2767
} finally {
2768
2768
closeShards (indexShard );
2769
2769
}
@@ -2793,7 +2793,7 @@ public void testDocStats() throws Exception {
2793
2793
});
2794
2794
long prevAccessTime = shard .getLastSearcherAccess ();
2795
2795
final DocsStats docsStats = indexShard .docStats ();
2796
- assertThat ("searcher was not marked as accessed" , shard .getLastSearcherAccess (), greaterThan (prevAccessTime ));
2796
+ assertThat ("searcher was marked as accessed" , shard .getLastSearcherAccess (), equalTo (prevAccessTime ));
2797
2797
assertThat (docsStats .getCount (), equalTo (numDocs ));
2798
2798
try (Engine .Searcher searcher = indexShard .acquireSearcher ("test" )) {
2799
2799
assertTrue (searcher .reader ().numDocs () <= docsStats .getCount ());
You can’t perform that action at this time.
0 commit comments