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 > > > 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 ;-) >>>> 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+unsubscr...@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.