File tree 2 files changed +4
-10
lines changed
main/java/org/elasticsearch/index/shard
test/java/org/elasticsearch/index/shard
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 @@ -2767,7 +2767,7 @@ public void testCompletionStatsMarksSearcherAccessed() throws Exception {
2767
2767
});
2768
2768
long prevAccessTime = shard .getLastSearcherAccess ();
2769
2769
indexShard .completionStats ();
2770
- assertThat ("searcher was not marked as accessed" , shard .getLastSearcherAccess (), greaterThan (prevAccessTime ));
2770
+ assertThat ("searcher was marked as accessed" , shard .getLastSearcherAccess (), equalTo (prevAccessTime ));
2771
2771
} finally {
2772
2772
closeShards (indexShard );
2773
2773
}
@@ -2797,7 +2797,7 @@ public void testDocStats() throws Exception {
2797
2797
});
2798
2798
long prevAccessTime = shard .getLastSearcherAccess ();
2799
2799
final DocsStats docsStats = indexShard .docStats ();
2800
- assertThat ("searcher was not marked as accessed" , shard .getLastSearcherAccess (), greaterThan (prevAccessTime ));
2800
+ assertThat ("searcher was marked as accessed" , shard .getLastSearcherAccess (), equalTo (prevAccessTime ));
2801
2801
assertThat (docsStats .getCount (), equalTo (numDocs ));
2802
2802
try (Engine .Searcher searcher = indexShard .acquireSearcher ("test" )) {
2803
2803
assertTrue (searcher .reader ().numDocs () <= docsStats .getCount ());
You can’t perform that action at this time.
0 commit comments