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
Remove dirty flag and force boolean for refresh #9484
Conversation
@@ -694,7 +684,7 @@ public boolean refreshNeeded() { | |||
try { | |||
// we are either dirty due to a document added or due to a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is a bit stale, e.g. says "dirty" (which is gone) and e.g. deletes can also mean we are not current ... I think just remove the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
LGTM, what a nice cleanup: 2 booleans and 1 mutex removed! |
@mikemccand I pushed updates |
LGTM, thanks @s1monw! |
Today we have a dirty flag indicating that a refresh must be executed. We also allow users to bypass this by setting a force=true boolean on the refresh request / command. All these flags are unneeded since the SearcherManager has all the information to do the right thing if it's dirty or not.
4431e90
to
03f1fcc
Compare
indexShard.refresh("api", request.force()); | ||
logger.trace("{} refresh request executed, force: [{}]", indexShard.shardId(), request.force()); | ||
indexShard.refresh("api"); | ||
logger.trace("{} refresh request executed, force: [{}]", indexShard.shardId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remove the "force:[{}]" in trace logger. @s1monw
Thanks @boliza I'll push a fix. |
@mikemccand @dakrone I think I should backport this to 1.x too. WDYT |
++ @s1monw |
yes, +1 on backport to 1.x |
Today we have a dirty flag indicating that a refresh must
be executed. We also allow users to bypass this by setting
a force=true boolean on the refresh request / command. All
these flags are unneeded since the SearcherManager has all
the information to do the right thing if it's dirty or not.