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() {
947947
948948 public DocsStats docStats () {
949949 readAllowed ();
950- DocsStats docsStats = getEngine ().docStats ();
951- markSearcherAccessed ();
952- return docsStats ;
950+ return getEngine ().docStats ();
953951 }
954952
955953 /**
@@ -1028,11 +1026,7 @@ public TranslogStats translogStats() {
10281026 public CompletionStats completionStats (String ... fields ) {
10291027 readAllowed ();
10301028 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 );
10361030 } catch (IOException e ) {
10371031 throw new UncheckedIOException (e );
10381032 }
Original file line number Diff line number Diff line change @@ -2767,7 +2767,7 @@ public void testCompletionStatsMarksSearcherAccessed() throws Exception {
27672767 });
27682768 long prevAccessTime = shard .getLastSearcherAccess ();
27692769 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 ));
27712771 } finally {
27722772 closeShards (indexShard );
27732773 }
@@ -2797,7 +2797,7 @@ public void testDocStats() throws Exception {
27972797 });
27982798 long prevAccessTime = shard .getLastSearcherAccess ();
27992799 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 ));
28012801 assertThat (docsStats .getCount (), equalTo (numDocs ));
28022802 try (Engine .Searcher searcher = indexShard .acquireSearcher ("test" )) {
28032803 assertTrue (searcher .reader ().numDocs () <= docsStats .getCount ());
You can’t perform that action at this time.
0 commit comments