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

Default detect_noop to true #11306

Merged
merged 1 commit into from Aug 27, 2015
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented May 22, 2015

detect_noop is pretty cheap and noop updates compartively expensive so this
feels like a sensible default.

Closes #11282

@clintongormley clintongormley added >breaking review :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. labels May 25, 2015
if the merging process doesn't cause any changes. Specifying `detect_noop`
as `true` will cause Elasticsearch to check if there are changes and, if
there aren't, turn the update request into a noop. For example:
By default if `doc` is specified then the document only updated even if the

Choose a reason for hiding this comment

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

"If doc is specified, its value is merged with the existing _source. By default, the document is only reindexed if the new _source field differs from the old. Setting detect_noop to false will cause Elasticsearch..."

@nik9000
Copy link
Member Author

nik9000 commented May 26, 2015

Updated with @clintongormley's language. Thanks. Its much clearer.

@jpountz jpountz self-assigned this Jun 19, 2015
@nik9000
Copy link
Member Author

nik9000 commented Jul 29, 2015

@jpountz, should I just take this one?

@jpountz
Copy link
Contributor

jpountz commented Jul 29, 2015

Yes, please :)

@nik9000
Copy link
Member Author

nik9000 commented Aug 3, 2015

This badly needed a rebase so I did it. Rerunning tests.

@nik9000
Copy link
Member Author

nik9000 commented Aug 11, 2015

I'd love to get this into 2.0.0 somehow - please review?

=== Updates now `detect_noop` by default

We've switched the default value of the `detect_noop` option from `false` to
`true` because its computationally cheap and we think its what users expect.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/its/it is/

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@jpountz
Copy link
Contributor

jpountz commented Aug 11, 2015

LGTM

@nik9000
Copy link
Member Author

nik9000 commented Aug 12, 2015

Ok - this looks to be approved for merge but needs conflicts resolved so I'll squash and rebase. And if the conflicts resolve easily I'll merge.

@nik9000
Copy link
Member Author

nik9000 commented Aug 12, 2015

Ok - rebasing shows a failing Rest test. I'll work on that and ask for another review when I can.

@nik9000
Copy link
Member Author

nik9000 commented Aug 13, 2015

OK - fixed the rest test and rebased so it can merge.

@jpountz
Copy link
Contributor

jpountz commented Aug 14, 2015

Is it possible to make detect_noop ttl-aware? If not, or if it would make things complicated, I don't think it would be too bad but then we should document it?

@nik9000
Copy link
Member Author

nik9000 commented Aug 14, 2015

Is it possible to make detect_noop ttl-aware? If not, or if it would make things complicated, I don't think it would be too bad but then we should document it?

Yeah - I'll have a look. Also, since this isn't going to make 2.0 I'll have to move/change some documentation.

@nik9000 nik9000 added v2.1.0 and removed v2.0.0 labels Aug 14, 2015
@nik9000
Copy link
Member Author

nik9000 commented Aug 14, 2015

Yeah - I'll have a look. Also, since this isn't going to make 2.0 I'll have to move/change some documentation.

@jpountz I went with the documentation option. Its pretty easy to just always update the document if it has a ttl set but I'm not super clear on the interplay between default ttl and updates. Nor could I figure out how to clear the ttl with an update so I couldn't test to make sure I wasn't breaking that. So I went the easy way and just documented that the expiration doesn't change if the document doesn't by default.

@nik9000
Copy link
Member Author

nik9000 commented Aug 24, 2015

Squashed and rebased onto master. Changed the migrate_2_1.asciidoc wording slightly.

@nik9000
Copy link
Member Author

nik9000 commented Aug 24, 2015

@jpountz ready for another round of review I think.

@@ -104,3 +104,6 @@ may still be retrieved before they are purged.
How many deletions are handled by a single <<docs-bulk,`bulk`>> request. The
default value is `10000`.

==== Note on `detect_noop`
If an update doesn't change the `_source` document it's expiration time won't
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should be more specific eg. "If an update tries to update the _ttl value but doesn't change the _source document"?

also s/it's/its/

Copy link
Member Author

Choose a reason for hiding this comment

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

It'll be done in the next push.

@jpountz
Copy link
Contributor

jpountz commented Aug 25, 2015

Sorry for the delay. I left two minor comments but in general it looks good to ne

@nik9000
Copy link
Member Author

nik9000 commented Aug 26, 2015

Sorry for the delay. I left two minor comments but in general it looks good to ne

Ok - moved the tests and fixed the docs as requested.

@jpountz
Copy link
Contributor

jpountz commented Aug 26, 2015

LGTM

@nik9000
Copy link
Member Author

nik9000 commented Aug 27, 2015

OK! I'll resolve squash and rebase. If the rebase is clean enough I'll push to master.

detect_noop is pretty cheap and noop updates compartively expensive so this
feels like a sensible default.

Also had to do some testing and documentation around how _ttl works with
detect_noop.

Closes elastic#11282
@nik9000
Copy link
Member Author

nik9000 commented Aug 27, 2015

All tests pass! Hurray! Merging.

nik9000 added a commit that referenced this pull request Aug 27, 2015
@nik9000 nik9000 merged commit 38fdacd into elastic:master Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In 2.0 detect_noop for updates should be on by default
3 participants