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

Merge some of update by document and script #629

Merged
merged 1 commit into from Jun 13, 2014

Conversation

nik9000
Copy link
Contributor

@nik9000 nik9000 commented Jun 5, 2014

These share many of the same options so it makes sense to merge them.

Closes #628
Closes #627

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 5, 2014

I'm not in love with the Updatable name but it gets the job done.

@ruflin
Copy link
Owner

ruflin commented Jun 8, 2014

This cuts out quite a bit of code. Nice. I'm also not a big fan of the name Updatable (sounds also like an interface). Should we call it Source (as you do in the code) or Object? Object is probably reserved...

How does elasticsearch treat a script? Same as a document? Means isn't a script extending a document? Are all the functions you put in Updatable supported by Script?

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 10, 2014

Everything on the Updatable object should be respected by updates, yeah. Source isn't really right because it really only works as the command you can give to an update action. UpdateCommand? Its a bit lame, but it makes some sense.

@ruflin
Copy link
Owner

ruflin commented Jun 10, 2014

Can Updatable be used alone? Probably not, so we could make it an abstract object to make it clear, it should not be used directly. UpdateAbstract? UpdatableAbstract? I don't want to block this pull request because of a name discussion. If we don't come to a name conclusion fast, lets just pick one :-)

Can you make the changes.txt update a little bit more extensive?

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 10, 2014

On Tue, Jun 10, 2014 at 5:00 PM, Nicolas Ruflin notifications@github.com
wrote:

Can Updatable be used alone? Probably not, so we could make it an abstract
object to make it clear, it should not be used directly. UpdateAbstract?
UpdatableAbstract? I don't want to block this pull request because of a
name discussion. If we don't come to a name conclusion fast, lets just pick
one :-)

AbstractUpdateAction?

Can you make the changes.txt update a little bit more extensive?

Sure, will do in the morning.

@ruflin
Copy link
Owner

ruflin commented Jun 10, 2014

(+1) for AbstractUpdateAction. Lets go with this one. Can you update this also in the code?

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 10, 2014

Yup. Will do in the morning.

On Tue, Jun 10, 2014 at 5:20 PM, Nicolas Ruflin notifications@github.com
wrote:

(+1) for AbstractUpdateAction. Lets go with this one. Can you update this
also in the code?


Reply to this email directly or view it on GitHub
#629 (comment).

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 11, 2014

Updated. Travis seems upset with me at the moment though.

@ruflin
Copy link
Owner

ruflin commented Jun 11, 2014

I restarted the build manually. Lets see what the outcome will be :-)

@ruflin
Copy link
Owner

ruflin commented Jun 11, 2014

@nik9000 Can you merge in master? Not sure if that is what makes Travis unhappy ...

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 11, 2014

Rebased on top of master. I can squash if you think that'll help.

@ruflin
Copy link
Owner

ruflin commented Jun 11, 2014

It starts building again :-) Not sure what the merge conflict will be... So if you can do the merge for me, more then welcome :-)

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 11, 2014

Squashed all my commits to one. Since its on top of master it should just merge clean.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.86%) when pulling 5b60b70 on nik9000:retry_bulk_script into c622ccf on ruflin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-14.32%) when pulling 5b60b70 on nik9000:retry_bulk_script into c622ccf on ruflin:master.

@ruflin
Copy link
Owner

ruflin commented Jun 11, 2014

The build doesn't look too good :-(

@ruflin
Copy link
Owner

ruflin commented Jun 12, 2014

BTW: I just updated the build to es 1.2.1

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 12, 2014

I fixed an obvious error and the tests look fixed locally but travis is still unhappy.

@ruflin
Copy link
Owner

ruflin commented Jun 13, 2014

I would assume that this "test failure" is based on your change:

1) Elastica\Test\ClientTest::testDeleteIdsIdxStringTypeString

But you said, this is working locally?

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 13, 2014

I can get it to fail every third time I run it locally. I'll see if I can track it down.

@ruflin
Copy link
Owner

ruflin commented Jun 13, 2014

Strange. Can you try optimize instead of refresh? Perhaps something changed to in the delete API?

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 13, 2014

#634

@ruflin
Copy link
Owner

ruflin commented Jun 13, 2014

Now we need to merge in the other changes.

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 13, 2014

Rebased and pushed. I'm running the tests again locally because I'll probably beat travis. It'd be useful to generate changes.txt on release rather then when as part of the pull request - it seems like the most likely thing to fail merges.

These share many of the same options so it makes sense to merge them.
This also adds support for things like _retry_on_conflict and _routing to
updates by scripts.

Closes ruflin#628
Closes ruflin#627
@nik9000
Copy link
Contributor Author

nik9000 commented Jun 13, 2014

Builds were looking good but I had to amend to fix a merge error I left in changes.txt.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling 23ab5ee on nik9000:retry_bulk_script into 61898fb on ruflin:master.

@ruflin
Copy link
Owner

ruflin commented Jun 13, 2014

Ok. Will run out of battery in a minute. Will merge it later.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.13%) when pulling 8e2cafe on nik9000:retry_bulk_script into 61898fb on ruflin:master.

ruflin added a commit that referenced this pull request Jun 13, 2014
Merge some of update by document and script
@ruflin ruflin merged commit c203800 into ruflin:master Jun 13, 2014
@ruflin
Copy link
Owner

ruflin commented Jun 13, 2014

Merged. Thx a lot for all the extra effort.

@nik9000
Copy link
Contributor Author

nik9000 commented Jun 13, 2014

Thanks!

On Fri, Jun 13, 2014 at 4:56 PM, Nicolas Ruflin notifications@github.com
wrote:

Merged. Thx a lot for all the extra effort.


Reply to this email directly or view it on GitHub
#629 (comment).

wmfgerrit pushed a commit to wikimedia/mediawiki-extensions-CirrusSearch that referenced this pull request Jun 17, 2014
If the document doesn't change then don't push a new copy of it into the
index.  Elasticsearch doesn't do this by default and updates are very
expensive.  This should prevent any that aren't really required.  I have an
instinct that says this is a pretty significant fraction of updates at WMF.
Instinct only, though.  We graph it in ganglia so we can be sure if it is
worth it.

Requires ruflin/Elastica#629 or we'll lose retry
on conflict support.

Change-Id: I533e08ac15d5e48d1de8b36e3b86a419f339be38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bulk scripts should also support retry_on_conflict Fields on Document should also be on script
3 participants