Skip to content

The watcher indexing listener didn't handle document level exceptions. #51466

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

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

martijnvg
Copy link
Member

Prior to the change the watcher index listener didn't implement the
postIndex(ShardId, Engine.Index, Engine.IndexResult) method. This
caused document level exceptions like VersionConflictEngineException
to be ignored. This commit fixes this.

The watcher indexing listener did implement the postIndex(ShardId, Engine.Index, Exception)
method, but that only handles engine level exceptions.

This change also unmutes the SmokeTestWatcherTestSuiteIT#testMonitorClusterHealth test again.

Relates to #32299 (this should fix the watch count bug, which wasn't subtracted from 1 to 0 due to VersionConflictEngineException being thrown after watcher updating the watch after it was deleted)

Prior to the change the watcher index listener didn't implement the
`postIndex(ShardId, Engine.Index, Engine.IndexResult)` method. This
caused document level exceptions like VersionConflictEngineException
to be ignored. This commit fixes this.

The watcher indexing listener did implement the `postIndex(ShardId, Engine.Index, Exception)`
method, but that only handles engine level exceptions.

This change also unmutes the SmokeTestWatcherTestSuiteIT#testMonitorClusterHealth test again.

Relates to elastic#32299
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Watcher)

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

@martijnvg - great catch ! LGTM

For my own knowledge is there a way to know which exception types are document related failures vs. engine level exceptions ?

Also, I assume that anytime someone overrides postIndex(ShardId shardId, Engine.Index index, Exception ex) they should probably also override postIndex(ShardId shardId, Engine.Index index, Engine.IndexResult result).

I wonder if the postIndex(ShardId shardId, Engine.Index index, Engine.IndexResult result) override defined here, should instead be the default implementation in the interface ? (in a different PR, that also includes postDelete)

@martijnvg
Copy link
Member Author

For my own knowledge is there a way to know which exception types are document related failures vs. engine level exceptions?

The bases class EngineException is used for both groups of exceptions. So that is a bit confusing.

The way I look at this is, that document level exceptions are failures related to an operation on a single doc, that doesn't have consequences for other documents or a shard. For example a version conflict or failure during index time text analysis.

The engine level failures affect the entire shard and can cause a shard to fail. For example a corruption that occurs during indexing.

I wonder if the postIndex(ShardId shardId, Engine.Index index, Engine.IndexResult result) override defined here, should instead be the default implementation in the interface ? (in a different PR, that also includes postDelete)

Not sure. Indexing operation listeners are very low level and this very much depends on the implementation.

@martijnvg martijnvg merged commit 547033b into elastic:master Jan 29, 2020
martijnvg added a commit that referenced this pull request Jan 29, 2020
#51466)

Prior to the change the watcher index listener didn't implement the
`postIndex(ShardId, Engine.Index, Engine.IndexResult)` method. This
caused document level exceptions like VersionConflictEngineException
to be ignored. This commit fixes this.

The watcher indexing listener did implement the `postIndex(ShardId, Engine.Index, Exception)`
method, but that only handles engine level exceptions.

This change also unmutes the SmokeTestWatcherTestSuiteIT#testMonitorClusterHealth test again.

Relates to #32299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants