Can I use the java client of newer version to connect to a old version server?

For some reasons, we have several separated elasticsearch clusters for our
front applicaitons. We want to upgrade our clusters' version to the newest
version but apparently it is impossible to upgrade all the clusters at the
same time, which means our single application have to connect to multiple
clusters with different versions.

My question is whether the elasticsearch java client has the ability to
work correctly with an old version server?

--
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/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xiaozhu@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters for our front applicaitons. We want to upgrade our clusters' version to the newest version but apparently it is impossible to upgrade all the clusters at the same time, which means our single application have to connect to multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability to work correctly with an old version server?

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/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com.
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/97C66A72-7C01-4059-9DCE-F6B568FEB7E1%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

As a test result, I got exceptions when I tried to use the newest 1.2.2
java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport_client_worker][T#1]{New
I/O worker #1}] [INFO ] org.elasticsearch.client.transport[105] -
[Slipstream] failed to get local cluster state for
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException:
[server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at
org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell
you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR <xia...@gmail.com <javascript:>> a
écrit :

For some reasons, we have several separated elasticsearch clusters for our
front applicaitons. We want to upgrade our clusters' version to the newest
version but apparently it is impossible to upgrade all the clusters at the
same time, which means our single application have to connect to multiple
clusters with different versions.

My question is whether the elasticsearch java client has the ability to
work correctly with an old version server?

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xiaozhu@gmail.com) a écrit:

As a test result, I got exceptions when I tried to use the newest 1.2.2 java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport_client_worker][T#1]{New I/O worker #1}] [INFO ] [] org.elasticsearch.client.transport[105] - [Slipstream] failed to get local cluster state for [#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException: [server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109) ~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:
Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters for our front applicaitons. We want to upgrade our clusters' version to the newest version but apparently it is impossible to upgrade all the clusters at the same time, which means our single application have to connect to multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability to work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com.
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/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com.
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/etPan.53bfb38f.1190cde7.70e%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/d/optout.

I am using TransportClient, the following is how I retrieve the client
instance:

Client client = new
TransportClient(sb.build()).addTransportAddresses(esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒,David Pilato写道:

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xia...@gmail.com <javascript:>) a
écrit:

As a test result, I got exceptions when I tried to use the newest 1.2.2
java client to connect to a 1.0.3 cluster:

18:05:41.020
[elasticsearch[Slipstream][transport_client_worker][T#1]{New I/O worker
#1}] [INFO ] org.elasticsearch.client.transport[105] - [Slipstream]
failed to get local cluster state for
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException:
[server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at
org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(ChannelBufferStreamInput.java:132)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.HandlesStreamInput.readString(HandlesStreamInput.java:61)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.common.io.stream.StreamInput.readStringArray(StreamInput.java:362)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.action.admin.cluster.state.ClusterStateRequest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:209)
~[elasticsearch-1.2.2.jar:na]
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will tell
you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters for
our front applicaitons. We want to upgrade our clusters' version to the
newest version but apparently it is impossible to upgrade all the clusters
at the same time, which means our single application have to connect to
multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability to
work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%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/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The code is suspicious since it has an explicit check for versions prior to
1.2

https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124

Don't know much else about the code to comment further.

Cheers,

Ivan

On Fri, Jul 11, 2014 at 3:30 AM, xzer LR xiaozhu@gmail.com wrote:

I am using TransportClient, the following is how I retrieve the client
instance:

Client client = new
TransportClient(sb.build()).addTransportAddresses(esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒,David Pilato写道:

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xia...@gmail.com) a écrit:

As a test result, I got exceptions when I tried to use the newest 1.2.2
java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport_client_worker][T#1]{New
I/O worker #1}] [INFO ] org.elasticsearch.client.transport[105] -
[Slipstream] failed to get local cluster state for
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException: [server-cat][inet[/
192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(
AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(
ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.HandlesStreamInput.
readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.
readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.action.admin.cluster.state.
ClusterStateRequest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(
MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.
messageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will
tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters for
our front applicaitons. We want to upgrade our clusters' version to the
newest version but apparently it is impossible to upgrade all the clusters
at the same time, which means our single application have to connect to
multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability to
work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%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/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%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/CALY%3DcQBCBTqfnetUsksf47M_QwtAjtSrRNVHsj-VN6%3DJb862Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I think I got the reason.

At first, I noticed that the row number from the exception stack is not
compatible to the client 1.2.2 source, then it exactly occurred at the old
version 1.0.3 server side.

Then the service side exception told us that it failed from reading the
last string array:

I recognized that the real problem is the client size did not check the
version correctly, then I digged the source more deeply, then I found the
following row which seems wrong:

DiscoveryNode node = new DiscoveryNode("#transport#-" + tempNodeIdGenerator
.incrementAndGet(), transportAddress, version);

The nodes passed to construct the transport client are simply initialized
as the current client version.

I have no idea how to fix it but it seems that it should be reported as a
bug?

在 2014年7月12日星期六UTC+9上午4时29分01秒,Ivan Brusic写道:

The code is suspicious since it has an explicit check for versions prior
to 1.2

https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L121-L124

Don't know much else about the code to comment further.

Cheers,

Ivan

On Fri, Jul 11, 2014 at 3:30 AM, xzer LR <xia...@gmail.com <javascript:>>
wrote:

I am using TransportClient, the following is how I retrieve the client
instance:

Client client = new
TransportClient(sb.build()).addTransportAddresses(esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒,David Pilato写道:

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xia...@gmail.com) a écrit:

As a test result, I got exceptions when I tried to use the newest
1.2.2 java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport_client_worker][T#1]{New
I/O worker #1}] [INFO ] org.elasticsearch.client.transport[105] -
[Slipstream] failed to get local cluster state for
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException:
[server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.readByte(
AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(
ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.HandlesStreamInput.
readString(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.
readStringArray(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.action.admin.cluster.state.
ClusterStateRequest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.
handleRequest(MessageChannelHandler.java:209)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.
messageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will
tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters
for our front applicaitons. We want to upgrade our clusters' version to the
newest version but apparently it is impossible to upgrade all the clusters
at the same time, which means our single application have to connect to
multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability to
work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%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/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You can not connect a newer TransportClient to a server which is older. You
can connect an older TransportClient to a newer server (without being able
to use new features).

Jörg

On Mon, Jul 14, 2014 at 10:36 AM, xzer LR xiaozhu@gmail.com wrote:

I think I got the reason.

At first, I noticed that the row number from the exception stack is not
compatible to the client 1.2.2 source, then it exactly occurred at the old
version 1.0.3 server side.

Then the service side exception told us that it failed from reading the
last string array:

https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132

I recognized that the real problem is the client size did not check the
version correctly, then I digged the source more deeply, then I found the
following row which seems wrong:

https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164

DiscoveryNode node = new DiscoveryNode("#transport#-" +
tempNodeIdGenerator.incrementAndGet(), transportAddress, version);

The nodes passed to construct the transport client are simply initialized
as the current client version.

I have no idea how to fix it but it seems that it should be reported as a
bug?

在 2014年7月12日星期六UTC+9上午4时29分01秒,Ivan Brusic写道:

The code is suspicious since it has an explicit check for versions prior
to 1.2

GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine
blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/
ClusterStateRequest.java#L121-L124

Don't know much else about the code to comment further.

Cheers,

Ivan

On Fri, Jul 11, 2014 at 3:30 AM, xzer LR xia...@gmail.com wrote:

I am using TransportClient, the following is how I retrieve the client
instance:

Client client = new TransportClient(sb.build()).addTransportAddresses(
esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒,David Pilato写道:

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xia...@gmail.com) a écrit:

As a test result, I got exceptions when I tried to use the newest
1.2.2 java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][transport_client_worker][T#1]{New
I/O worker #1}] [INFO ] org.elasticsearch.client.transport[105] -
[Slipstream] failed to get local cluster state for
[#transport#-1][e-note][inet[/192.168.200.81:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException:
[server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.
readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.readByte(
ChannelBufferStreamInput.java:132) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.HandlesStreamInput.readSt
ring(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readStringArr
ay(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.action.admin.cluster.state.ClusterStateReq
uest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.hand
leRequest(MessageChannelHandler.java:209) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.mess
ageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will
tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters
for our front applicaitons. We want to upgrade our clusters' version to the
newest version but apparently it is impossible to upgrade all the clusters
at the same time, which means our single application have to connect to
multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability
to work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%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/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%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/CAKdsXoHz3Fvs3PtvoyvH7FcjzG0WDmdSeAwcGB9FvB5ocFGSgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thank you for the comment, according to the source, it seems you are right.

I will try a converse test

在 2014年7月14日星期一UTC+9下午6时36分03秒,Jörg Prante写道:

You can not connect a newer TransportClient to a server which is older.
You can connect an older TransportClient to a newer server (without being
able to use new features).

Jörg

On Mon, Jul 14, 2014 at 10:36 AM, xzer LR <xia...@gmail.com <javascript:>>
wrote:

I think I got the reason.

At first, I noticed that the row number from the exception stack is not
compatible to the client 1.2.2 source, then it exactly occurred at the old
version 1.0.3 server side.

Then the service side exception told us that it failed from reading the
last string array:

https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java#L132

I recognized that the real problem is the client size did not check the
version correctly, then I digged the source more deeply, then I found the
following row which seems wrong:

https://github.com/elasticsearch/elasticsearch/blob/1.0/src/main/java/org/elasticsearch/client/transport/TransportClientNodesService.java#L164

DiscoveryNode node = new DiscoveryNode("#transport#-" +
tempNodeIdGenerator.incrementAndGet(), transportAddress, version);

The nodes passed to construct the transport client are simply
initialized as the current client version.

I have no idea how to fix it but it seems that it should be reported as a
bug?

在 2014年7月12日星期六UTC+9上午4时29分01秒,Ivan Brusic写道:

The code is suspicious since it has an explicit check for versions prior
to 1.2

GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine
blob/master/src/main/java/org/elasticsearch/action/admin/cluster/state/
ClusterStateRequest.java#L121-L124

Don't know much else about the code to comment further.

Cheers,

Ivan

On Fri, Jul 11, 2014 at 3:30 AM, xzer LR xia...@gmail.com wrote:

I am using TransportClient, the following is how I retrieve the client
instance:

Client client = new TransportClient(sb.build()).addTransportAddresses(
esAddresses);

在 2014年7月11日星期五UTC+9下午6时51分26秒,David Pilato写道:

Are you using a TransportClient or NodeClient?
If NodeClient, could you try with the TransportClient?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr

Le 11 juillet 2014 à 11:14:59, xzer LR (xia...@gmail.com) a écrit:

As a test result, I got exceptions when I tried to use the newest
1.2.2 java client to connect to a 1.0.3 cluster:

18:05:41.020 [elasticsearch[Slipstream][tra
nsport_client_worker][T#1]{New I/O worker #1}] [INFO ]
org.elasticsearch.client.transport[105] - [Slipstream] failed to get
local cluster state for [#transport#-1][e-note][inet[/192.168.200.81:9300]],
disconnecting...
org.elasticsearch.transport.RemoteTransportException:
[server-cat][inet[/192.168.21.81:9300]][cluster/state]
java.lang.IndexOutOfBoundsException: Readable byte limit exceeded: 48
at org.elasticsearch.common.netty.buffer.AbstractChannelBuffer.
readByte(AbstractChannelBuffer.java:236) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.ChannelBufferStreamInput.r
eadByte(ChannelBufferStreamInput.java:132)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readVInt(StreamInput.java:141)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readString(StreamInput.java:272)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.HandlesStreamInput.readSt
ring(HandlesStreamInput.java:61) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.common.io.stream.StreamInput.readStringArr
ay(StreamInput.java:362) ~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.action.admin.cluster.state.ClusterStateReq
uest.readFrom(ClusterStateRequest.java:132)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.hand
leRequest(MessageChannelHandler.java:209)
~[elasticsearch-1.2.2.jar:na]
at org.elasticsearch.transport.netty.MessageChannelHandler.mess
ageReceived(MessageChannelHandler.java:109)
~[elasticsearch-1.2.2.jar:na]

I didn't find any metioned break change about this exceptioin.

在 2014年7月4日星期五UTC+9下午3时31分07秒,David Pilato写道:

Well. It depends.

1.0 is incompatible with 0.90
1.2 should work with 1.x IIRC.

From 1.0, we try to keep this compatible. If not, release notes will
tell you.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 juil. 2014 à 07:09, xzer LR xia...@gmail.com a écrit :

For some reasons, we have several separated elasticsearch clusters
for our front applicaitons. We want to upgrade our clusters' version to the
newest version but apparently it is impossible to upgrade all the clusters
at the same time, which means our single application have to connect to
multiple clusters with different versions.

My question is whether the elasticsearch java client has the ability
to work correctly with an old version server?

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/baa98ec5-ffcf-46f9-bfdd-7afbd213b19d%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%40goo
glegroups.com
https://groups.google.com/d/msgid/elasticsearch/77e32825-812a-46c8-82b4-93a5e4b12788%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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%
40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df3afd7e-b0a5-4d26-a777-fc887427bbed%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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/86ad8e40-fae6-4581-9972-4c68a0db9d37%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/060d9aac-793a-40f9-8e78-5400537cc310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

To demonstrate how a single java application can connect and query to both elasticsearch1.x and 2.x servers i have a sample application based on classloaders. https://github.com/atulsm/ElasticsearchClassLoader

That's great. I'd create a new thread for this.