Error when using VersionType.EXTERNAL_GTE in 1.1.0

Hello team - I just switched over to 1.1.0 and changed from
VersionType.EXTERNAL to VersionType.EXTERNAL_GTE. Ever since then, we are
seeing the error below.

Any comments?

I looked at ES code and see this newly added line for EXTERNAL_GTE. Does it
mean we dont support zero as a valid version number? Our systems use zero
as the start version number.

   @Override
    public boolean validateVersion(long version) {
        return version > 0L;
    }

org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: illegal version value [0] for version type [EXTERNAL_GTE];
at
org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:29)
at
org.elasticsearch.action.index.IndexRequest.validate(IndexRequest.java:181)
at
org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:63)
at
org.elasticsearch.client.transport.support.InternalTransportClient$2.doWithNode(InternalTransportClient.java:109)
at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:228)
at
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
at
org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:82)
at
org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:330)
at
org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:314)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)

-Amit.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQLCjgK02bvDvhg0U%3DO-G2u2-BFR095y4%2Bb%3DXVho48K_DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Also to add: it seems that even VersionType.EXTERNAL is broken in the new
version (1.1.0) since it now does the validation of input version number
and it does not allow a save if the input version number is zero.

Looking for inputs from ES team on how to proceed on this.

-Amit.

On Mon, Mar 31, 2014 at 12:02 PM, Amit Soni amitsoni29@gmail.com wrote:

Hello team - I just switched over to 1.1.0 and changed from
VersionType.EXTERNAL to VersionType.EXTERNAL_GTE. Ever since then, we are
seeing the error below.

Any comments?

I looked at ES code and see this newly added line for EXTERNAL_GTE. Does
it mean we dont support zero as a valid version number? Our systems use
zero as the start version number.

   @Override
    public boolean validateVersion(long version) {
        return version > 0L;
    }

org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: illegal version value [0] for version type [EXTERNAL_GTE];
at
org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:29)
at
org.elasticsearch.action.index.IndexRequest.validate(IndexRequest.java:181)
at
org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:63)
at
org.elasticsearch.client.transport.support.InternalTransportClient$2.doWithNode(InternalTransportClient.java:109)
at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:228)
at
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
at
org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:82)
at
org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:330)
at
org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:314)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)

-Amit.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQJvCiF%2BWogUpgZwmEwHNsM4kR8PYTaUHBWqn59-xCmuPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hello team - Can you pl comment on this please?

-Amit.

On Mon, Mar 31, 2014 at 12:11 PM, Amit Soni amitsoni29@gmail.com wrote:

Also to add: it seems that even VersionType.EXTERNAL is broken in the new
version (1.1.0) since it now does the validation of input version number
and it does not allow a save if the input version number is zero.

Looking for inputs from ES team on how to proceed on this.

-Amit.

On Mon, Mar 31, 2014 at 12:02 PM, Amit Soni amitsoni29@gmail.com wrote:

Hello team - I just switched over to 1.1.0 and changed from
VersionType.EXTERNAL to VersionType.EXTERNAL_GTE. Ever since then, we are
seeing the error below.

Any comments?

I looked at ES code and see this newly added line for EXTERNAL_GTE. Does
it mean we dont support zero as a valid version number? Our systems use
zero as the start version number.

   @Override
    public boolean validateVersion(long version) {
        return version > 0L;
    }

org.elasticsearch.action.ActionRequestValidationException: Validation
Failed: 1: illegal version value [0] for version type [EXTERNAL_GTE];
at
org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:29)
at
org.elasticsearch.action.index.IndexRequest.validate(IndexRequest.java:181)
at
org.elasticsearch.action.TransportActionNodeProxy.execute(TransportActionNodeProxy.java:63)
at
org.elasticsearch.client.transport.support.InternalTransportClient$2.doWithNode(InternalTransportClient.java:109)
at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:228)
at
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
at
org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:82)
at
org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:330)
at
org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:314)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)

-Amit.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQL4EsD37TPGmW89QTcM0YpvEK4zwT%2BJ9u35Fe8%2BvSwoOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thank you for reporting this, the plan is to revert back and allow 0 for
external versioning. Not sure yet when it will be but likely in the next 1
or 2 releases.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/27cac5e1-acec-4fa4-a937-4a16e8711533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks for confirming Binh. We look forward to the change and we can
upgrade only after this change is done else it would break our system.

Do you want me to create a bug for this?

-Amit.

On Thu, Apr 3, 2014 at 2:09 PM, Binh Ly binhly_es@yahoo.com wrote:

Thank you for reporting this, the plan is to revert back and allow 0 for
external versioning. Not sure yet when it will be but likely in the next 1
or 2 releases.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/27cac5e1-acec-4fa4-a937-4a16e8711533%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/27cac5e1-acec-4fa4-a937-4a16e8711533%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQLLeRuK0oPX_f203RC2%2BcXsiv6iz8BVUR5VCG7Jzx_omA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Amit,

One solid work-around is to always create the index before you bulk-load
it. Either with explicit mappings or letting ES guess them by default
should work fine. It should get you by until the bug is fixed in a future
release, and should be rather easy to implement.

In my case, I lock down ES to prevent auto-index creation and auto-create
of unmapped fields, so I must always create the index and its mappings
before loading data into the index. This means that I haven't run into this
bug. And it's not a bad workaround; in fact, it is a very good practice.
Sometimes ES guesses wrong. It can't read my mind, so I don't expect it to.

Hope this helps.

Brian

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0eba0b15-d012-4858-b6c5-3f10591c6869%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Brian - Thanks for the response, appreciate it. I am not sure if I
understand this solution completely. We already create the index in advance
(we use strict mapping and we have also disabled dynamic creation of new
types) and then only we start indexing. We however supply the version
number from our DB and that is where version number of zero comes in from.

Can you pl clarify!

-Amit.

On Thu, Apr 3, 2014 at 9:16 PM, InquiringMind brian.from.fl@gmail.comwrote:

Amit,

One solid work-around is to always create the index before you bulk-load
it. Either with explicit mappings or letting ES guess them by default
should work fine. It should get you by until the bug is fixed in a future
release, and should be rather easy to implement.

In my case, I lock down ES to prevent auto-index creation and auto-create
of unmapped fields, so I must always create the index and its mappings
before loading data into the index. This means that I haven't run into this
bug. And it's not a bad workaround; in fact, it is a very good practice.
Sometimes ES guesses wrong. It can't read my mind, so I don't expect it to.

Hope this helps.

Brian

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/0eba0b15-d012-4858-b6c5-3f10591c6869%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/0eba0b15-d012-4858-b6c5-3f10591c6869%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAOGaQL5FxVPR2uKBqnyjMr0dabYgNzivP8VdhErmXOHw_%2BUZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.