Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Adding CheckpointRefreshListener to trigger when Segment replication is turned on and Primary shard refreshes #3108
Adding CheckpointRefreshListener to trigger when Segment replication is turned on and Primary shard refreshes #3108
Changes from 12 commits
4addc10
37f49d2
3210e33
730b601
b216116
4928270
7777d1e
fa39d47
5907f0b
e40dc41
5a9d544
46557bb
7ac0b90
ff91dec
9bbfe20
4c97019
bd17e4f
6c75f6d
d78e8ae
cf7c92e
591e608
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm thinking we should overload the constructor here (or subclass indexShard) and conditionally use it if segrep is enabled when IndexShards are created from IndexService.
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.
The logic for creating an
IndexShard
should take of injecting the correct concrete implementation or noop as neededThere 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 isn't used anywhere? It should be wired up in
newEngineConfig
below.Should this be an internal or external listener?
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.
Yes, I will wire this up. But not sure if it should be external or internal listener. I am using internal listener for now, we can have a discussion on this.
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.
Lets push this down to the creation of
IndexShard
so that we can minimize the branching across the board and create the right flavour ofIndexShard
for segrepThere 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.
I liked this idea at first, but I think we should maybe leave this block while the feature is still behind feature flags. Once the feature flag is removed then we wire up the listener even if its a NoOp.
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.
Nitpick - can be written as:
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.
@kartg this we how we have it now, The above highlighted one is outdated.
Also if we try to write it as your suggested way, then internalRefreshListeners cannot be final, we have been using it as final even before this PR. Not sure if changing internalRefreshListener to a non-final variable is a good idea.
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.
Given that this block declares and defines the
internalRefreshListener
variable, thefinal
modifier doesn't add value IMO. What is more valuable to maintain is the unmodifiable list, which is lost ifcheckpointRefreshListener
is non-null.If you'd really like to retain the
final
modifier, I'd suggest doing something like this: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.
@kartg I tried to incorporate your code block, but it throws me UnsupportedOperation Exception when we are adding,
"refreshListenerList.add(checkpointRefreshListener);"
. As we are usingArrays.asList(new RefreshMetricUpdater(refreshMetric));
we cannot use .add method. Instead we have to again convert this into actual List. More about this exception can be found here. As this is a nitpick I am just using the way how it was before to avoid complexity