whatyouhide / xandra

Fast, simple, and robust Cassandra/ScyllaDB driver for Elixir.
ISC License
403 stars 54 forks source link

Verify that Scylla works with the driver #112

Closed lexmag closed 5 years ago

lexmag commented 6 years ago

Scylla: http://www.scylladb.com.

theevangelista commented 6 years ago

Hey lexmag, do you have any idea on how to achieve that? We could run the tests against a scylla node or an app which implements calls to scylla using xandra as the driver. If the tests implements specs for the CQL then it would suffice since scylla is a drop in for cassandra.

scohen commented 6 years ago

FYI, we're going to be experimenting with Scylla and Xandra. We'll keep you posted.

theevangelista commented 6 years ago

Nice, I was starting a simple project to try the queries of scylla documentation, think this would help?

lexmag commented 6 years ago

Hi folks, I though about the following plan:

Please let me know if you've already done or plan to do any of those. Thanks for pushing this forward. 💛

theevangelista commented 6 years ago

I though on something similar, we could:

I've searched for the Scylla drivers and there isn't an official one, all of them are Cassandra drivers that people tested, and others are believed to work 1.

theevangelista commented 6 years ago

Later today I'll try to build the test matrix for Scylla on Travis

theevangelista commented 6 years ago

I did the matrix, wrapped the current Cassandra install and add a clause to check if the env var is set, then use Scylla. I'm currently working on my fork. The result of build have some errors on Scylla part, 6 tests of the suite failed. The build is available here. A raw log is here

queer commented 6 years ago

If it helps, I've been running Xandra against some Scylla instances in test right now and it's been working 100% fine here, although I'm not doing anything "fancy" with it.

zmagajna commented 6 years ago

I came across a problem few weeks ago:

(EXIT from #PID<0.752.0>) evaluator process exited with reason: an exception was raised:
(FunctionClauseError) no function clause matching in Xandra.Protocol.decode_type/1
(xandra) lib/xandra/protocol.ex:812: Xandra.Protocol.decode_type(<<0, 17, 0, 2, 116, 115, 0, 2, 0, 15, 99, 111, 114, 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 105, 100, 0, 9, 0, 9, 97, 99, 99, 95, 97, 110, 103, 108, 101, 0, 8, 0, 8, 97, 99, 99, 95, 114, 97, 116, 101, ...>>)
(xandra) lib/xandra/protocol.ex:807: Xandra.Protocol.decode_columns/4
(xandra) lib/xandra/protocol.ex:614: Xandra.Protocol.decode_metadata/2
(xandra) lib/xandra/protocol.ex:547: Xandra.Protocol.decode_result_response/3
(xandra) lib/xandra/connection.ex:59: Xandra.Connection.handle_prepare/3
(db_connection) lib/db_connection.ex:966: DBConnection.handle/4
(db_connection) lib/db_connection.ex:1043: anonymous fn/3 in DBConnection.run_prepare/3
(db_connection) lib/db_connection.ex:1207: DBConnection.run_begin/3

I was tring to prepare statements for the batch insert into ScyllaDB, and the response back was this. If that helps.

theevangelista commented 6 years ago

I got several of those in Travis, seems it can't decode binary types

zmagajna commented 6 years ago

So i dig a bit more into test and one is failing:

1) test dynamic result columns (PreparedTest)
     test/integration/prepared_test.exs:47
     match (=) failed
     code:  assert {:ok, page} = Xandra.execute(conn, prepared)
     right: {:error,
             %Xandra.Error{message: "Not implemented: LWT",
              reason: :server_failure}}
     stacktrace:
       test/integration/prepared_test.exs:51: (test)

As I check a bit on this test on ScyllaDB Github, here is the answer:

Scylla does not support light-weight transactions (LWT), which are required for the IF NOT EXISTS syntax you are using above. See #1359 for more discussion on supporting LWT.

Should this test be excluded with some tag when running tests on ScyllaDB?

Also i think i fixed problems with wrong decoding types on my fork.

whatyouhide commented 6 years ago

Should this test be excluded with some tag when running tests on ScyllaDB?

Yes.

zmagajna commented 6 years ago

Added the tag on my fork, could somebody take a look if this is the by project guideline, or should I change things?

whatyouhide commented 6 years ago

That looks okay to me.

zmagajna commented 6 years ago

Should I also make the Travis configuration on the project? And if somebody can help me with the configuration to test both on Cassandra and ScyllaDB?

zmagajna commented 6 years ago

So I have made a pull request for the ScyllaDB now just one test is failing I'm just wondering if someone could some guidance as on why this test is failing?

  1) test using a default timestamp for the batch (BatchTest)
     test/integration/batch_test.exs:55
     Assertion with == failed
     code:  Enum.to_list(result) == [%{"name" => "Abed", "writetime(name)" => timestamp}, %{"name" => "Troy", "writetime(name)" => timestamp}]
     left:  [%{"name" => "Marge", "writetime(name)" => 1526925340295329}, %{"name" => "Homer", "writetime(name)" => 1526925340295329}]
     right: [%{"name" => "Abed", "writetime(name)" => 1526924740}, %{"name" => "Troy", "writetime(name)" => 1526924740}]
     stacktrace:
       test/integration/batch_test.exs:65: (test)
zmagajna commented 6 years ago

Found the bug, was the wrong configuration in .travis.yaml PR is ready to merge.

zmagajna commented 5 years ago

Since it is merged you can close this issue. Sorry, couldn't help at the final stages had too much on mine plate.