Skip to content

Conversation

@dakrone
Copy link
Member

@dakrone dakrone commented Jan 19, 2017

This is a bespoke backport of #20109 for 5.x:

Currently, bulk item requests can be any ActionRequest, this PR restricts bulk
item requests to DocumentRequest. This simplifies handling failures during bulk
requests. Additionally, a new enum is added to DocumentRequest to represent the
intended operation to be performed by a document request (create, index, update
and delete), which was previously represented with a mix of strings and index
request operation type.

Now, index request operation type reuses the new enum to specify whether the
request should create or index a document. Restricting bulk requests to
DocumentRequest further simplifies execution of shard-level bulk operations to
use the same failure handling for index, delete and update operations. This PR
also fixes a bug which executed delete operations twice for replica copies while
executing bulk requests.

Relates to #19105 and #20109

Copy link
Contributor

@areek areek left a comment

Choose a reason for hiding this comment

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

Thanks @dakrone! LGTM, left a couple of minor comments

Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove the unused imports here (namely: ActionRequest, DocWriteRequest.OpType, ReplicationRequest, ShardId and RestStatus)

Copy link
Contributor

Choose a reason for hiding this comment

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

minor: fix indentation

@dakrone dakrone force-pushed the backport-bulk-single-op-actions branch from 52d67e6 to 6b99aad Compare January 23, 2017 21:40
@dakrone
Copy link
Member Author

dakrone commented Jan 23, 2017

Thanks for taking a look @areek!

This is a bespoke backport of elastic#20109 for 5.x:

Currently, bulk item requests can be any ActionRequest, this PR restricts bulk
item requests to DocumentRequest. This simplifies handling failures during bulk
requests. Additionally, a new enum is added to DocumentRequest to represent the
intended operation to be performed by a document request (create, index, update
and delete), which was previously represented with a mix of strings and index
request operation type.

Now, index request operation type reuses the new enum to specify whether the
request should create or index a document. Restricting bulk requests to
DocumentRequest further simplifies execution of shard-level bulk operations to
use the same failure handling for index, delete and update operations. This PR
also fixes a bug which executed delete operations twice for replica copies while
executing bulk requests.

Relates to elastic#19105 and elastic#20109
@dakrone dakrone force-pushed the backport-bulk-single-op-actions branch from 6b99aad to 3dfa414 Compare January 23, 2017 22:34
@dakrone dakrone merged commit 3dfa414 into elastic:5.x Jan 23, 2017
@dakrone dakrone deleted the backport-bulk-single-op-actions branch June 13, 2017 18:02
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.

2 participants