Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DocsStats into Engine #33835

Merged
merged 4 commits into from
Sep 19, 2018
Merged

Move DocsStats into Engine #33835

merged 4 commits into from
Sep 19, 2018

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Sep 18, 2018

By moving DocStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibiltiy out of IndexShard
which has quiet some complexity already.

By moving DocStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibiltiy out of IndexShard
which has quiet some complexity already.
@s1monw s1monw added >enhancement v7.0.0 :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. v6.5.0 labels Sep 18, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good but I left one question about test on the side, which I am fine with being in a follow-up too.

}
return new DocsStats(numDocs, numDeletedDocs, sizeInBytes);
DocsStats docsStats = getEngine().docStats();
markSearcherAccessed();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test for this? It could have gotten lost here. I looked (IndexShardTests#testDocStats) but did not see one. Would you add one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@s1monw
Copy link
Contributor Author

s1monw commented Sep 19, 2018

@elasticmachine test this please

@tlrx
Copy link
Member

tlrx commented Sep 19, 2018

Nice change - NoOpEngine can benefit from it too

@tlrx
Copy link
Member

tlrx commented Sep 19, 2018

@s1monw Do you plan to do the same thing cor completionStats() too?

@s1monw
Copy link
Contributor Author

s1monw commented Sep 19, 2018

@tlrx you can read my mind ey :)

s1monw added a commit to s1monw/elasticsearch that referenced this pull request Sep 19, 2018
By moving CompletionStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibiltiy out of IndexShard
which has quiet some complexity already.

Relates to elastic#33835
Copy link
Contributor

@bleskes bleskes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@s1monw s1monw merged commit 0c77f45 into elastic:master Sep 19, 2018
@s1monw s1monw deleted the cache_doc_stats branch September 19, 2018 09:03
s1monw added a commit that referenced this pull request Sep 19, 2018
By moving DocStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibility out of IndexShard
which has quiet some complexity already.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Sep 19, 2018
* master: (46 commits)
  Fixing assertions in integration test (elastic#33833)
  [CCR] Rename idle_shard_retry_delay to poll_timout in auto follow patterns (elastic#33821)
  HLRC: Delete ML calendar (elastic#33775)
  Move DocsStats into Engine (elastic#33835)
  [Docs] Clarify accessing Date methods in painless (elastic#33560)
  add elasticsearch-shard tool (elastic#32281)
  Cut over to unwrap segment reader (elastic#33843)
  SQL: Fix issue with options for QUERY() and MATCH(). (elastic#33828)
  Emphasize that filesystem-level backups don't work (elastic#33102)
  Use the global doc id to generate a random score (elastic#33599)
  Add minimal sanity checks to custom/scripted similarities. (elastic#33564)
  Profiler: Don’t profile NEXTDOC for ConstantScoreQuery. (elastic#33196)
  [CCR] Change FollowIndexAction.Request class to be more user friendly (elastic#33810)
  SQL: day and month name functions tests locale providers enforcement (elastic#33653)
  TESTS: Set SO_LINGER = 0 for MockNioTransport (elastic#32560)
  Test: Relax jarhell gradle test (elastic#33787)
  [CCR] Fail with a descriptive error if leader index does not exist (elastic#33797)
  Add ES version 6.4.2 (elastic#33831)
  MINOR: Remove Some Dead Code in Scripting (elastic#33800)
  Ensure realtime `_get` and `_termvectors` don't run on the network thread (elastic#33814)
  ...
s1monw added a commit to s1monw/elasticsearch that referenced this pull request Sep 19, 2018
s1monw added a commit that referenced this pull request Sep 19, 2018
s1monw added a commit that referenced this pull request Sep 19, 2018
By moving CompletionStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibiltiy out of IndexShard
which has quiet some complexity already.

Relates to #33835
s1monw added a commit that referenced this pull request Sep 19, 2018
By moving CompletionStats into the engine we can easily cache the stats for
read-only engines if necessary. It also moves the responsibiltiy out of IndexShard
which has quiet some complexity already.

Relates to #33835
s1monw added a commit to s1monw/elasticsearch that referenced this pull request Mar 26, 2019
Completion and DocStats are pulled from internal readers
instead of external since elastic#33835 and elastic#33847 which doesn't require
us to refresh after a stats call since refreshes will happen internally
anyhow and that will cause updated stats on ongoing indexing.
s1monw added a commit that referenced this pull request Apr 2, 2019
Completion and DocStats are pulled from internal readers
instead of external since #33835 and #33847 which doesn't require
us to refresh after a stats call since refreshes will happen internally
anyhow and that will cause updated stats on ongoing indexing.
s1monw added a commit that referenced this pull request Apr 2, 2019
Completion and DocStats are pulled from internal readers
instead of external since #33835 and #33847 which doesn't require
us to refresh after a stats call since refreshes will happen internally
anyhow and that will cause updated stats on ongoing indexing.
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Completion and DocStats are pulled from internal readers
instead of external since elastic#33835 and elastic#33847 which doesn't require
us to refresh after a stats call since refreshes will happen internally
anyhow and that will cause updated stats on ongoing indexing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants