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

support for cassandra database versions 2.0, 2.1, 2.2, 3.0 #21

Closed
vetss opened this issue Feb 21, 2016 · 4 comments
Closed

support for cassandra database versions 2.0, 2.1, 2.2, 3.0 #21

vetss opened this issue Feb 21, 2016 · 4 comments
Assignees
Milestone

Comments

@vetss
Copy link
Contributor

vetss commented Feb 21, 2016

Now SMSC GW is based on top of cassandra database versions 1.2.
We need to add support for versions 2.* and 3.0.

@vetss
Copy link
Contributor Author

vetss commented Feb 21, 2016

After adding the new cassandra driver and testing of compatibility I have found that:
currect driver version is compatible with cassandra database 1.2 and 2.0
2.1 driver version is compatible with cassandra database 2.0 and 2.1
I have taken the last official release (2.1.6). 2.2 and 3.0 versions are BETA, I have not tested them.
Detailed feedback:

  1. for database driver 2.1.6 we need following updates:
    switching to netty 4.0.7 (SMPP uses now 3.9.). Versions 3. and 4.* are fully incompatible (and have even different classes namespaces), so we have to have both on board. There is a "shaded" version of a cassandra driver that already have netty 4.0 onboard, I am using this one.
    http://datastax.github.io/java-driver/2.1.6/features/shaded_jar/
    cassandra 2.1 driver needs that we set values even they are null. THis is also updated.
    I have removed from binaries cassandra-trift, libtrift, cassandra-all, it looks like it works without it.
  2. I have faced with the problem that cassandra driver 2.1 does not work with cassandra database 1.2 (: Datastax declares that it supports but it does not work. When I use PreparedStatement, I have the error at cassandra log like:
    ERROR [Native-Transport-Requests:216] 2015-06-18 21:44:48,813 ErrorMessage.java (line 210) Unexpected exception during request
    java.lang.IndexOutOfBoundsException: Not enough readable bytes - Need 4, maximum is 0
    at org.jboss.netty.buffer.AbstractChannelBuffer.checkReadableBytes(AbstractChannelBuffer.java:661)
    at org.jboss.netty.buffer.AbstractChannelBuffer.readInt(AbstractChannelBuffer.java:273)
    at org.apache.cassandra.transport.CBUtil.readValue(CBUtil.java:248)
    at org.apache.cassandra.transport.messages.ExecuteMessage$1.decode(ExecuteMessage.java:49)
    at org.apache.cassandra.transport.messages.ExecuteMessage$1.decode(ExecuteMessage.java:41)
    at org.apache.cassandra.transport.Message$ProtocolDecoder.decode(Message.java:210)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:66)
    at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:68)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    Non-Prepared statement works. But Non-Prepared leads of compiling at each database request and this reduce productivity, so I do not like it.
    I have not found any workaround in the Internet and no bug reports or feedback.
  3. I made first testing, I need some testing more may be including load-testing at some customer.
    Conclusions: ***
    Switching to cassandra drivers 2.1 will lead that SMSC GW installations with cassandra 1.2 database will stop of woring. So we need of "soft" updating process. We need to release 6.2.2.GA in two versions
    6.2.2.GA - with old drivers
    6.2.2.GA_LC - with 2.1 drivers
    so customers will be able to select the proper cassandra version for use.
    The we must recommend to switch to cassandra 2.0 or 2.1 before the customer can use next SMSC GW version.

@vetss
Copy link
Contributor Author

vetss commented Feb 21, 2016

Important !!!
TODO: we need to provide a clear explanation in the manual of cassandra versions supporing / roadmap !!!

@vetss vetss changed the title support for cassandra database versions 2.0 and 2.1 support for cassandra database versions 2.0, 2.1, 2.2, 3.0 Mar 4, 2016
@vetss
Copy link
Contributor Author

vetss commented Mar 13, 2016

Fixed by:
0fa7838
18168c2

@vetss vetss added this to the 3.0.0 milestone Mar 13, 2016
@vetss vetss self-assigned this Mar 13, 2016
@vetss vetss closed this as completed Mar 13, 2016
@adutra
Copy link

adutra commented Mar 22, 2016

FYI the bug you described in your previous comment is tracked as JAVA-1132. Unless I'm missing something, it should only affect bound statements with no variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants