Giter VIP home page Giter VIP logo

scylla-tools-java's Introduction

Scylla tools

This repository contains nodetool and other Apache Cassandra compatible tools for Scylla.

Please refer to the Scylla git repository for more information how to build and run the tools.

scylla-tools-java's People

Contributors

adelapena avatar aweisberg avatar bdeggleston avatar belliottsmith avatar beobal avatar blambov avatar blerer avatar carlyeks avatar driftx avatar gdusbabek avatar iamaleksey avatar ifesdjeen avatar jasobrown avatar jbellis avatar jeffjirsa avatar jmckenzie-dev avatar krummas avatar mebigfatguy avatar michaelsembwever avatar mishail avatar mshuler avatar pauloricardomg avatar pcmanus avatar snazy avatar syuu1228 avatar thobbs avatar tjake avatar vijay2win avatar xedin avatar yukim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scylla-tools-java's Issues

create materialized view accepts empty "where" clause, but then fails on all subsequent ops

If I create a simple table like:


create keyspace ks WITH replication={ 'class' : 'SimpleStrategy', 'replication_factor' : 1 } ; 
use ks;
create table  test (pk text primary key, c0 int, c1 int, c2 int);
insert into test (pk, c0, c1, c2) values('apa', 1, 2, 3);
insert into test (pk, c0, c1, c2) values('kossa', 4, 5, 6);

then do

create materialized view test_by_c2 as select c2, c1, c0, pk from test primary key (c2, pk);

it succeeds. But both queries, and more importantly, inserts into the test table, will fail due to the generated select statement being broken (WHERE ALLOW..).

Note that origin also does not handle an empty where, so maybe the problem is that we allow the view creating without where clause.

'nodetool info': Scylla API server HTTP GET to URL '/storage_service/tokens/null' failed: Wrong format for IPv4 address null. Please ensure it's in dotted-decimal format

scylla 2.0.rc1-20170730

3 nodes in the cluster, run 'nodetool info'

[centos@ip-172-30-0-65 ~]$ nodetool info
ID                     : a1e8318e-26b1-4aaa-98b7-055b0f355d77
Gossip active          : true
Thrift active          : false
Native Transport active: false
Load                   : 31.34 MB
Generation No          : 1501623729
Uptime (seconds)       : 1826
Heap Memory (MB)       : 155.36 / 247.50
Off Heap Memory (MB)   : 181.83
Data Center            : datacenter1
Rack                   : rack1
Exceptions             : 0
Key Cache              : entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, 0.000 recent hit rate, 0 save period in seconds
Row Cache              : entries 495, size 495 bytes, capacity 15.15 MB, 9485 hits, 10047 requests, 0.944 recent hit rate, 0 save period in seconds
Counter Cache          : entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, 0.000 recent hit rate, 0 save period in seconds
nodetool: Scylla API server HTTP GET to URL '/storage_service/tokens/null' failed: Wrong format for IPv4 address null. Please ensure it's in dotted-decimal format
See 'nodetool help' or 'nodetool help <command>'.
[centos@ip-172-30-0-65 ~]$ ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 172.30.0.65  netmask 255.255.255.0  broadcast 172.30.0.255
        inet6 fe80::1073:6ff:fec1:c4ae  prefixlen 64  scopeid 0x20<link>
        ether 12:73:06:c1:c4:ae  txqueuelen 1000  (Ethernet)
        RX packets 16077878  bytes 10439516379 (9.7 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15849567  bytes 3568297664 (3.3 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 318294  bytes 329509190 (314.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 318294  bytes 329509190 (314.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sstableloader returns exit code 0 even if writes failed

It prints errors on stderr, but still will returns a success. May be a problem when this is run through some automation.

Relevant code in BulkLoader.java:

                semaphore.acquire();
                try {
                    ResultSetFuture future = session.executeAsync(s);
                    Futures.addCallback(future, new FutureCallback<ResultSet>() {
                        @Override
                        public void onSuccess(ResultSet result) {
                            semaphore.release();
                        }

                        @Override
                        public void onFailure(Throwable t) {
                            semaphore.release();
                            System.err.println(t);
                        }
                    }, MoreExecutors.directExecutor());
                } finally {
                }

byteman-install-3.0.3.jar is broken on clean build environment

Build scylla-tools-java after rm -rf ~/.m2 && rm -rf build/, we get corrupted byteman-install-3.0.3.jar:

[artifact:dependencies] Transferring 38K from central
[artifact:dependencies] Downloading: org/jboss/byteman/byteman-install/3.0.3/byteman-install-3.0.3.jar from repository ow2 at http://repository.ow2.org/nexus/content/repositories/releases/
[artifact:dependencies] Transferring 0K from ow2
[artifact:dependencies] [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'f34133d4bfa9b62a50fe0aa1ee1fdd8fed853c84'; remote = '<!DOCTYPE' - RETRYING
[artifact:dependencies] Downloading: org/jboss/byteman/byteman-install/3.0.3/byteman-install-3.0.3.jar from repository ow2 at http://repository.ow2.org/nexus/content/repositories/releases/
[artifact:dependencies] Transferring 0K from ow2
[artifact:dependencies] [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'f34133d4bfa9b62a50fe0aa1ee1fdd8fed853c84'; remote = '<!DOCTYPE' - IGNORING
     [copy] Copying 9 files to /home/syuu/scylla-tools-java.2/build/lib/jars
    [unzip] Expanding: /home/syuu/scylla-tools-java.2/build/lib/jars/org.jacoco.agent-0.7.5.201505241946.jar into /home/syuu/scylla-tools-java.2/build/lib/jars

check-gen-cql3-grammar:

gen-cql3-grammar:

generate-cql-html:
[artifact:dependencies] Downloading: com/datastax/wikitext/wikitext-core-ant/1.3/wikitext-core-ant-1.3.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 3K from central
[artifact:dependencies] Downloading: org/sonatype/oss/oss-parent/5/oss-parent-5.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 4K from central
[artifact:dependencies] Downloading: org/fusesource/wikitext/wikitext-core/1.3/wikitext-core-1.3.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 2K from central
[artifact:dependencies] Downloading: org/fusesource/wikitext/wikitext-project/1.3/wikitext-project-1.3.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 4K from central
[artifact:dependencies] Downloading: org/fusesource/fusesource-pom/1.3/fusesource-pom-1.3.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 13K from central
[artifact:dependencies] Downloading: org/fusesource/wikitext/textile-core/1.3/textile-core-1.3.pom from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 1K from central
[artifact:dependencies] Downloading: org/fusesource/wikitext/wikitext-core/1.3/wikitext-core-1.3.jar from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Downloading: com/datastax/wikitext/wikitext-core-ant/1.3/wikitext-core-ant-1.3.jar from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 32K from central
[artifact:dependencies] Transferring 237K from central
[artifact:dependencies] Downloading: org/fusesource/wikitext/textile-core/1.3/textile-core-1.3.jar from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Transferring 54K from central

build-project:
     [echo] apache-cassandra: /home/syuu/scylla-tools-java.2/build.xml
    [javac] Compiling 45 source files to /home/syuu/scylla-tools-java.2/build/classes/thrift
    [javac] error: error reading /home/syuu/scylla-tools-java.2/build/lib/jars/byteman-install-3.0.3.jar; error in opening zip file
    [javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.openjdk.jmh.generators.BenchmarkProcessor' less than -source '1.8'
    [javac] 1 warning
    [javac] Compiling 1274 source files to /home/syuu/scylla-tools-java.2/build/classes/main
    [javac] error: error reading /home/syuu/scylla-tools-java.2/build/lib/jars/byteman-install-3.0.3.jar; error in opening zip file
    [javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.openjdk.jmh.generators.BenchmarkProcessor' less than -source '1.8'
    [javac] 1 warning
    [javac] Creating empty /home/syuu/scylla-tools-java.2/build/classes/main/org/apache/cassandra/hints/package-info.class

createVersionPropFile:
[propertyfile] Updating property file: /home/syuu/scylla-tools-java.2/src/resources/org/apache/cassandra/config/version.properties
     [copy] Copying 2 files to /home/syuu/scylla-tools-java.2/build/classes/main

BUILD FAILED
/home/syuu/scylla-tools-java.2/build.xml:772: Warning: Could not find file /home/syuu/scylla-tools-java.2/build/classes/main/META-INF/hotspot_compiler to copy.

The .jar is not even zip archive, it's HTML:

syuu@monster:~/scylla-tools-java.2$ file build/lib/jars/byteman-install-3.0.3.jar 
build/lib/jars/byteman-install-3.0.3.jar: HTML document, ASCII text
syuu@monster:~/scylla-tools-java.2$ cat build/lib/jars/byteman-install-3.0.3.jar 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://repository.ow2.org/nexus/content/repositories/releases/org/jboss/byteman/byteman-install/3.0.3/byteman-install-3.0.3.jar">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at repository.ow2.org Port 80</address>
</body></html>

build_dep.sh fails on Ubuntu 14.04 because of "missing com.sun:tools:jar:1.6"

It seems because ant doesn't using java-8, able to fix by update-alternatives --config java to choose java-8.

BUILD FAILED
/home/ubuntu/workspace/scylla-master-ubuntu-deb/scylla-tools-java/build.xml:632: Unable to resolve artifact: Missing:
----------
1) com.sun:tools:jar:1.6

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.6 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.6 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
  	1) org.apache.cassandra:cassandra-coverage-deps:jar:666.development
  	2) org.jboss.byteman:byteman-bmunit:jar:3.0.3
  	3) com.sun:tools:jar:1.6

----------
1 required artifact is missing.

for artifact: 
  org.apache.cassandra:cassandra-coverage-deps:jar:666.development

ProtocolError when trying to connect to Scylla 1.6.1

While connecting to Scylla 1.6.1:

Connection error: ('Unable to connect to any servers', {'127.0.0.1': DriverException('ProtocolError returned from server while using explicitly set client protocol_version 4',)})

sstabledump unable to load schema

Scylla version: master

sstabledump is unable to load the schema to process a sstable, and fails with a NullPointerException.

To repro, just create any table and insert some data:

echo "create keyspace ks with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };" | $SCYLLA_TOOLS_HOME/bin/cqlsh
echo "create table ks.cf(p text, c text, v int, primary key (p, c));" |  $SCYLLA_TOOLS_HOME/bin/cqlsh
for i in `seq 1 1000`; do echo  "insert into ks.cf (p, c, v) values ('key1', '$i', 0);" ; done | $SCYLLA_TOOLS_HOME/bin/cqlsh

Trying to use sstabledump results in:

$SCYLLA_TOOLS_HOME/tools/bin/sstabledump $SCYLLA_DATA_DIR/ks/cf-aa2f2690120611e7aaaf000000000000/ks-cf-ka-1-Data.db
Exception in thread "main" java.lang.NullPointerException
	at org.apache.cassandra.io.sstable.format.SSTableReader.open(SSTableReader.java:471)
	at org.apache.cassandra.io.sstable.format.SSTableReader.openNoValidation(SSTableReader.java:387)
	at org.apache.cassandra.tools.SSTableExport.run(SSTableExport.java:202)
	at com.scylladb.tools.SSTableExport.main(SSTableExport.java:37)

Apparently, the column family metadata is null, which gets returned in com.scylladb.tools.SSTableExport#metadataFromSSTable, by Schema.instance.getCFMetaData(desc). A few lines before we try to do a local query to load the schemas, but that obviously returns nothing.

SStableloader fails to load a subset of BatchStatement inserted rows

I'm running into a very strange (but reproducible) issue when trying to import via the sstablesloader found in the latest Scylla docker image.

  • It only happens to a portion of any data that was inserted via batch statements using the python-based cassandra driver (tried 2.5, 2.6, 3.3 and a few more). [maybe it's all language drivers that use that same protocol?]
  • If I insert using raw CQL batch statements via cqlsh, it works.
  • If I copy the same SStables, and reload them into a clean cassandra 2.1.8 container, it works.

Only when I try to load the SStables into Scylla does a subset of the row fail to restore... and only if they were originally inserted via a batch statement.

Here are the rough steps I follow on each permutation of my tests:

  1. Clear all data directories and SStables
  2. Start a single node apache cassandra 2.1.8 docker container
  3. Create my keyspace and schema, via cqlsh
  4. Run following script against it to insert some data
  5. Run ./bin/nodetool flush, to persist from memtable to sstables.
  6. Stop the cassandra container
  7. Start a Scylla container (latest on docker hub), with sstable volume mounted
  8. Create my keyspace and schema, via cqlsh
  9. Load the SStables ./bin/sstableloader -v -d 172.17.0.2 /var/sstables/local/tree-....
  10. Check query for missing rows

I boiled my code down to this simple script, with two variations of the inserts (batch and simple):

from cassandra.cluster import Cluster
from cassandra.query import BatchStatement, SimpleStatement

cluster = Cluster(['localhost'])
session = cluster.connect('local')

def batch_insert(pairs):
    batch = BatchStatement()
    for root, name in pairs:
        cql = "INSERT INTO tree (root, name) VALUES (%s, %s)"
        params = (root, name)
        batch.add(SimpleStatement(cql), params)
    session.execute(batch)

def simple_insert(pairs):
    for root, name in pairs:
        cql = "INSERT INTO tree (root, name) VALUES (%s, %s)"
        params = (root, name)
        session.execute(cql, params)

root_name_pairs = [
    ('test', 'test'),
    ('test', 'test.nottest'),
    ('test.nottest', 'test.nottest'),
    ('test.nottest', 'test.nottest.basic'),
    ('test.nottest.basic', 'test.nottest.basic')
]

If all data is inserted directly using simple_insert, basically inserting one at a time, it works in every case:

simple_insert(root_name_pairs)
cqlsh> select * from local.tree;

 root               | name               | is_alias | is_data | target | timezone
--------------------+--------------------+----------+---------+--------+----------
               test |               test |     null |    null |   null |     null
               test |       test.nottest |     null |    null |   null |     null
       test.nottest |       test.nottest |     null |    null |   null |     null
       test.nottest | test.nottest.basic |     null |    null |   null |     null
 test.nottest.basic | test.nottest.basic |     null |    null |   null |     null

If data is inserted via BatchStatement, it inserts, but after flushing, exporting SStables, and sstableloading, Scylla only loads a subset of the rows:

batch_insert(root_name_pairs)
    cqlsh> select * from local.tree;

     root               | name               | is_alias | is_data | target | timezone
    --------------------+--------------------+----------+---------+--------+----------
                   test |               test |     null |    null |   null |     null
           test.nottest |       test.nottest |     null |    null |   null |     null
     test.nottest.basic | test.nottest.basic |     null |    null |   null |     null

    (3 rows)

However, I can take that same SStable and load it into Cassandra 2.1.8 and it's fine.

Here's my current schema

CREATE KEYSPACE IF NOT EXISTS local
WITH REPLICATION = {
    'class' : 'SimpleStrategy',
    'replication_factor': 1
};

use local;

CREATE TABLE IF NOT EXISTS tree (
    root text,
    name text,
    target text,
    timezone text,
    is_data boolean,
    is_alias boolean,
    PRIMARY KEY ((root), name)
);

Thanks!

cqlsh is unable to start on slow/loaded clusters

Setup
HEAD: branch-1.6 01b0514

Description
cqlsh is missing a way to configure a cassandra.cluster.Cluster()'s control_connection_timeout parameter. By default this value is set to 2s, which has proven to be not enough. As a result on slow or loaded Nodes this results in cqlsh failure to start.

$ cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=None, last_host=None',)})

This issue is a duplicate of C*'s cqlsh issue: https://issues.apache.org/jira/browse/CASSANDRA-10959

We need to:

  1. Increase a default.
  2. Make sure cqlsh allows to override the default by either/both value in the cqlshrc or/and the command line option.

sstableloader might drop clustering information if timestamps are mismatched

Loading "m" tables via sstableloader it was discovered these had row timestamps differing from (some) actual row cell timestamps. Since we try to break up statements into per-timestamp chunks, this caused clustering columns and regular columns to become disjoint in inserts. Which of course is not ok.

Mismatched timestamps in turn is not weird, it is just an overlooked issue because apparently no previous incarnation of test data (at least via the "legacy loader" path) encountered this.

Solution is obviously to always generate clustering data on each statement.

CentOS: scylla-sstableloader shows an error message when scylla-tools-core and scylla-conf package installed

Since we don't have files /etc/scylla/cassandra/* on scylla-tools-core package, scylla-sstableloader causes error when /etc/scylla/scylla.yaml provided by scylla-conf package.
We need to move /etc/scylla/cassandra/* from scylla-tools to scylla-tools-core package.

$  /usr/bin/scylla-sstableloader
mv: cannot stat '/tmp/tmp.Hnx28hzeAm/cassandra/*': No such file or directory
/usr/share/scylla/cassandra/cassandra.in.sh: line 23: /usr/bin/filter_cassandra_attributes.py: No such file or directory
Missing sstable directory argument
usage: sstableloader [options] <dir_path>

Bulk load the sstables found in the directory <dir_path> to the configured
cluster.The parent directories of <dir_path> are used as the target
keyspace/table name. So for instance, to load an sstable named
Standard1-g-1-Data.db into Keyspace1/Standard1, you will need to have the
files Standard1-g-1-Data.db and Standard1-g-1-Index.db into a directory
/path/to/Keyspace1/Standard1/.
 -alg,--ssl-alg <ALGORITHM>                          Client SSL: algorithm
                                                     (default: SunX509)
 -b,--use-batch                                      batch updates for
                                                     same partition key.
 -ciphers,--ssl-ciphers <CIPHER-SUITES>              Client SSL:
                                                     comma-separated list of encryption suites to use
 -cph,--connections-per-host <connectionsPerHost>    number of concurrent
                                                     connections-per-host.
 -d,--nodes <initial hosts>                          Required. try to
                                                     connect to these hosts (comma separated) initially for ring information
 -f,--conf-path <path to config file>                cassandra.yaml file
                                                     path for streaming throughput and client/server SSL.
 -g,--ignore-missing-columns <COLUMN NAMES...>       ignore named missing
                                                     columns in tables
 -h,--help                                           display this help
                                                     message
 -i,--ignore <NODES>                                 don't stream to this
                                                     (comma separated) list of nodes
 -ks,--keystore <KEYSTORE>                           Client SSL: full path
                                                     to keystore
 -kspw,--keystore-password <KEYSTORE-PASSWORD>       Client SSL: password
                                                     of the keystore
    --no-progress                                    don't display
                                                     progress
 -p,--port <port>                                    port used for
                                                     connections (default 9042)
 -prtcl,--ssl-protocol <PROTOCOL>                    Client SSL:
                                                     connections protocol to use (default: TLS)
 -pw,--password <password>                           password for
                                                     cassandra authentication
 -s,--ssl <SSL>                                      Use SSL connection(s)
 -sim,--simulate                                     simulate. Only print
                                                     CQL generated
 -st,--store-type <STORE-TYPE>                       Client SSL: type of
                                                     store
 -t,--throttle <throttle>                            throttle speed in
                                                     Mbits (default unlimited)
 -ts,--truststore <TRUSTSTORE>                       Client SSL: full path
                                                     to truststore
 -tspw,--truststore-password <TRUSTSTORE-PASSWORD>   Client SSL: password
                                                     of the truststore
 -u,--username <username>                            username for
                                                     cassandra authentication
 -v,--verbose                                        verbose output
 -x,--use-prepared                                   prepared statements

You can provide cassandra.yaml file with -f command line option to set up
streaming throughput, client and server encryption options. Only
stream_throughput_outbound_megabits_per_sec, server_encryption_options and
client_encryption_options are read from yaml. You can override options
read from cassandra.yaml with corresponding command line options.

Extend sstableloader to support missing values

v4 protocol supports missing values, so we can have a single prepared statement for inserts and supply missing values for columns that are not present in the sstable. This can reduce prepare work.

dist: errors/warnings on ubuntu package building

Need similar patchset we merged on scylla-server

Now running lintian...
W: scylla-tools source: native-package-with-dash-version
W: scylla-tools source: diff-contains-git-control-dir .git
W: scylla-tools source: diff-contains-editor-backup-file dist/ubuntu/.build_deb.sh.swp
W: scylla-tools source: dh_pysupport-is-obsolete line 41
W: scylla-tools source: maintainer-also-in-uploaders
E: scylla-tools source: build-depends-on-obsolete-package build-depends: dpatch
W: scylla-tools source: dpatch-build-dep-but-no-patch-list
W: scylla-tools source: patch-system-but-no-source-readme
W: scylla-tools source: debian-rules-missing-recommended-target build-arch
W: scylla-tools source: debian-rules-missing-recommended-target build-indep
W: scylla-tools source: ancient-standards-version 3.8.3 (current is 3.9.5)
W: scylla-tools: wrong-name-for-upstream-changelog usr/share/doc/scylla-tools/CHANGES.txt.gz
W: scylla-tools: extended-description-line-too-long
W: scylla-tools: script-with-language-extension usr/bin/cassandra_attributes.py
W: scylla-tools: script-with-language-extension usr/bin/filter_cassandra_attributes.py
W: scylla-tools: binary-without-manpage usr/bin/cassandra-stress
W: scylla-tools: binary-without-manpage usr/bin/cassandra-stressd
W: scylla-tools: binary-without-manpage usr/bin/cassandra_attributes.py
W: scylla-tools: binary-without-manpage usr/bin/cqlsh
W: scylla-tools: binary-without-manpage usr/bin/filter_cassandra_attributes.py
W: scylla-tools: binary-without-manpage usr/bin/json2sstable
W: scylla-tools: binary-without-manpage usr/bin/nodetool
W: scylla-tools: binary-without-manpage usr/bin/sstable2json
W: scylla-tools: binary-without-manpage usr/bin/sstablekeys
W: scylla-tools: binary-without-manpage usr/bin/sstablelevelreset
W: scylla-tools: binary-without-manpage usr/bin/sstableloader
W: scylla-tools: binary-without-manpage usr/bin/sstablemetadata
W: scylla-tools: binary-without-manpage usr/bin/sstablerepairedset
W: scylla-tools: binary-without-manpage usr/bin/sstablescrub
W: scylla-tools: binary-without-manpage usr/bin/sstablesplit
W: scylla-tools: binary-without-manpage usr/bin/sstableupgrade
W: scylla-tools: binary-without-manpage usr/bin/token-generator
W: scylla-tools: executable-not-elf-or-script usr/bin/cassandra_attributes.py
Finished running lintian.

'nodetool version' shows wrong version

based on http://docs.scylladb.com/nodetool-commands/version/

Nodetool version

version - Print the DB version Example

nodetool version

but nodetool doesn't show the correct scylla version

[centos@ip-172-30-0-65 ~]$ nodetool version
ReleaseVersion: 3.0.8
[centos@ip-172-30-0-65 ~]$ rpm -qa| grep scylla
scylla-tools-core-2.0.rc1-20170730.8e1ef86.el7.centos.noarch
scylla-debuginfo-2.0.rc1-0.20170730.aaa59d3.el7.centos.x86_64
scylla-env-1.0-1.el7.centos.noarch
scylla-conf-2.0.rc1-0.20170730.aaa59d3.el7.centos.x86_64
scylla-tools-2.0.rc1-20170730.8e1ef86.el7.centos.noarch
scylla-server-2.0.rc1-0.20170730.aaa59d3.el7.centos.x86_64
scylla-2.0.rc1-0.20170730.aaa59d3.el7.centos.x86_64
scylla-gdb-7.10.1-30.el7.centos.x86_64
scylla-kernel-conf-2.0.rc1-0.20170730.aaa59d3.el7.centos.x86_64
scylla-jmx-2.0.rc1-20170730.3451d25.el7.centos.noarch

dist: errors/warnings with rpmlint

build/rpmbuild/SPECS/scylla-tools.spec:77: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cassandra_pylib-0.0.0-py2.7.egg-info
build/rpmbuild/SPECS/scylla-tools.spec:78: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/__init__.py
build/rpmbuild/SPECS/scylla-tools.spec:79: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/__init__.pyc
build/rpmbuild/SPECS/scylla-tools.spec:80: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/__init__.pyo
build/rpmbuild/SPECS/scylla-tools.spec:81: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cql3handling.py
build/rpmbuild/SPECS/scylla-tools.spec:82: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cql3handling.pyc
build/rpmbuild/SPECS/scylla-tools.spec:83: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cql3handling.pyo
build/rpmbuild/SPECS/scylla-tools.spec:84: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cqlhandling.py
build/rpmbuild/SPECS/scylla-tools.spec:85: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cqlhandling.pyc
build/rpmbuild/SPECS/scylla-tools.spec:86: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/cqlhandling.pyo
build/rpmbuild/SPECS/scylla-tools.spec:87: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/displaying.py
build/rpmbuild/SPECS/scylla-tools.spec:88: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/displaying.pyc
build/rpmbuild/SPECS/scylla-tools.spec:89: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/displaying.pyo
build/rpmbuild/SPECS/scylla-tools.spec:90: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/formatting.py
build/rpmbuild/SPECS/scylla-tools.spec:91: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/formatting.pyc
build/rpmbuild/SPECS/scylla-tools.spec:92: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/formatting.pyo
build/rpmbuild/SPECS/scylla-tools.spec:93: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/helptopics.py
build/rpmbuild/SPECS/scylla-tools.spec:94: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/helptopics.pyc
build/rpmbuild/SPECS/scylla-tools.spec:95: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/helptopics.pyo
build/rpmbuild/SPECS/scylla-tools.spec:96: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/pylexotron.py
build/rpmbuild/SPECS/scylla-tools.spec:97: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/pylexotron.pyc
build/rpmbuild/SPECS/scylla-tools.spec:98: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/pylexotron.pyo
build/rpmbuild/SPECS/scylla-tools.spec:99: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/saferscanner.py
build/rpmbuild/SPECS/scylla-tools.spec:100: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/saferscanner.pyc
build/rpmbuild/SPECS/scylla-tools.spec:101: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/saferscanner.pyo
build/rpmbuild/SPECS/scylla-tools.spec:102: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/sslhandling.py
build/rpmbuild/SPECS/scylla-tools.spec:103: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/sslhandling.pyc
build/rpmbuild/SPECS/scylla-tools.spec:104: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/sslhandling.pyo
build/rpmbuild/SPECS/scylla-tools.spec:105: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/tracing.py
build/rpmbuild/SPECS/scylla-tools.spec:106: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/tracing.pyc
build/rpmbuild/SPECS/scylla-tools.spec:107: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/tracing.pyo
build/rpmbuild/SPECS/scylla-tools.spec:108: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/util.py
build/rpmbuild/SPECS/scylla-tools.spec:109: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/util.pyc
build/rpmbuild/SPECS/scylla-tools.spec:110: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/util.pyo
build/rpmbuild/SPECS/scylla-tools.spec:111: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/wcwidth.py
build/rpmbuild/SPECS/scylla-tools.spec:112: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/wcwidth.pyc
build/rpmbuild/SPECS/scylla-tools.spec:113: E: hardcoded-library-path in %{_prefix}/lib/python2.7/site-packages/cqlshlib/wcwidth.pyo
build/rpmbuild/SPECS/scylla-tools.spec: W: invalid-url Source0: scylla-tools-0.10-20151130.c3b669f.tar
0 packages and 1 specfiles checked; 37 errors, 1 warnings.

tag naming convention?

Hi,

Latest tag for 2.0.rc1 release has changed convention with the rest of the scylla repositories with the addition of a -core in the tag name scylla-core-2.0.rc1

Is is intended to stay like this in the future? I'm asking because it's a bit messy to maintain packaging consistency with tag names changes on release cycles.

Thanks!

ssttableloader crashes on cql row delete

When sstabeloading an sstable with a deleted cql row, sstableloader crashes.

java.lang.NullPointerException
    at com.scylladb.tools.SSTableToCQL$RowBuilder.deleteColumn(SSTableToCQL.java:323)
    at com.scylladb.tools.SSTableToCQL$RowBuilder.process(SSTableToCQL.java:612)
    at com.scylladb.tools.SSTableToCQL$RowBuilder.processAtoms(SSTableToCQL.java:589)
    at com.scylladb.tools.SSTableToCQL$RowBuilder.process(SSTableToCQL.java:581)
    at com.scylladb.tools.SSTableToCQL$RowBuilder.access$1(SSTableToCQL.java:556)
    at com.scylladb.tools.SSTableToCQL.process(SSTableToCQL.java:777)
    at com.scylladb.tools.SSTableToCQL.stream(SSTableToCQL.java:806)
    at com.scylladb.tools.BulkLoader.main(BulkLoader.java:706)

nodetool allocates ~1GB

nodetool allocates too much memory, causing OOM on small machines or is we have no swap.

I traced this to the call to java -version. It's perhaps not surprising that to print its version number, Java needs 1 gigabyte of memory.

sstableloader usage string does not require host (nodes)

Running sstabeloader without a host, the following usage is returnes:

> sstableloader a-dir
Initial hosts must be specified (-d)
usage: sstableloader [options] <dir_path>

The usage string does not require host, which seems to be required
Should be

usage: sstableloader -d nodes [options] <dir_path>

cqlsh doesn't work with Python 2.7.12

HEAD: 287262b
Python cassandra-driver version: 2.7.2

cqlsh fails to work with Python 2.7.12 which happens to be a default Python version on Ubuntu 16.04 since Jul 17 2016.

This is how an error looks like:

$ ./bin/cqlsh  127.0.0.2
Connection error: ('Unable to connect to any servers', {'127.0.0.2': TypeError('ref() does not take keyword arguments',)})

Using Python 2.7.11 fixes the problem.

sstableloader is not able to load default sstable created via cassandra-stress

Our cassandra-stress creates tables via CQL not via Thrift

CREATE KEYSPACE keyspace1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

CREATE TABLE keyspace1.standard1 (
    key blob PRIMARY KEY,
    "C0" blob,
    "C1" blob,
    "C2" blob,
    "C3" blob,
    "C4" blob
) WITH COMPACT STORAGE
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
    AND compression = {}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

If these specific tables are created via CQL then the created files can not be loaded via our sstableloader

attempting todo so will fail with

com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier c4
	at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
	at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
	at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:214)
	at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
	at com.scylladb.tools.BulkLoader$CQLClient.finish(BulkLoader.java:308)
	at com.scylladb.tools.SSTableToCQL.stream(SSTableToCQL.java:816)
	at com.scylladb.tools.BulkLoader.main(BulkLoader.java:706)
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Unknown identifier c4
	at com.datastax.driver.core.Responses$Error.asException(Responses.java:102)
	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:149)
	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:183)
	at com.datastax.driver.core.RequestHandler.access$2300(RequestHandler.java:44)
	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:751)
	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:573)
	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1009)
	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:932)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
	at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722)
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
	at java.lang.Thread.run(Thread.java:745)
.
.
.

To reproduce:

  1. start a single node
  2. run cassandra-stress write n=1000
  3. run nodetool flush
  4. run nodetool snapshot
  5. cd into the snapshot dir
  6. mkdir -p keyspace1/standard1
  7. mv keyspace1-standard1-* keyspace1/standard1
  8. try to upload the created snapshot files using sstableloader -v -d <ip> keyspace1/standard1

this also happens with cassandra is used as the backend for the writes - that is - instead of starting a scylla node start a cassandra 2.1.15 node and then use scylla's cassandra-stress and sstableloader to load the info - it will fail.

found by @larisau

After loading table that contains timestamp data type with millisec numbers, the millisec numbers are not presented in Scylla 1.7.1 cqlsh (though binary value is the same)

Created the following Schema and data on Cassandra 3.10:
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

USE mykeyspace;

CREATE TYPE mykeyspace.udt_info (birthday date, nationality text, height int);

CREATE TABLE all_types_no_counter_no_duration (aascii ascii, abigint bigint, ablob blob, aboolean boolean, adecimal decimal, adouble double, afloat float, ainet inet, aint int, atext text, atimestamp timestamp, atimeuuid timeuuid, auuid uuid,
avarchar varchar, avarint varint, alist list, amap map<int,int>, aset set, atinyint tinyint, asmallint smallint, adate date, atime time, afrozen_udt frozen<udt_info>, atuple tuple<int,text>, PRIMARY KEY (aascii, abigint) );

INSERT INTO all_types_no_counter_no_duration (aascii, abigint, ablob, aboolean, adecimal, adouble, afloat, ainet, aint, atext, atimestamp, atimeuuid, auuid, avarchar, avarint, alist, amap, aset, atinyint, asmallint, adate, atime, afrozen_udt, atuple)
VALUES ('tzach', 1999, bigintAsBlob(3), true, 10 , 10.10, 11.11 , '204.202.130.223', 17, 'text' ,'2016-08-30 14:01:55', maxTimeuuid('2013-01-01 00:05+0000'), 123e4567-e89b-12d3-a456-426655440000, 'tzachvarchar', 17, [1,2,3], {1 : 2}, {1,2,3,4}, 8, 16,
'2016-09-30', '12:14:56.789', { birthday : '1993-06-18', nationality : 'New Zealand', height : 180 }, (111, 'aaa') );

INSERT INTO all_types_no_counter_no_duration (aascii, abigint, ablob, aboolean, adecimal, adouble, afloat, ainet, aint, atext, atimestamp, atimeuuid, auuid, avarchar, avarint, alist, amap, aset, atinyint, asmallint, adate, atime, afrozen_udt, atuple)
VALUES ('tzach', 2000, bigintAsBlob(3), true, 10 , 10.10, 11.11 , '204.202.130.223', 17, 'text' ,'2016-08-30 07:01:00', maxTimeuuid('2013-01-01 00:05+0000'), 123e4567-e89b-12d3-a456-426655440000, 'tzachvarchar', 17, [1,2,3], {1 : 2}, {1,2,3,4}, 32, 64,
'2016-08-30', '12:24:56.789', { birthday : '1994-06-18', nationality : 'Israel', height : 185 }, (222, 'bbb') );

INSERT INTO all_types_no_counter_no_duration (aascii, abigint, ablob, aboolean, adecimal, adouble, afloat, ainet, aint, atext, atimestamp, atimeuuid, auuid, avarchar, avarint, alist, amap, aset, atinyint, asmallint, adate, atime, afrozen_udt, atuple)
VALUES ('livyatan', 2001, bigintAsBlob(3), true, 10 , 10.10, 11.11 , '204.202.130.223', 17, 'text' ,'2016-08-30 07:01:00', maxTimeuuid('2013-01-01 00:05+0000'), 123e4567-e89b-12d3-a456-426655440000, 'tzachvarchar', 17, [1,2,3], {1 : 2}, {1,2,3,4}, 16, 512,
'2016-08-30', '12:34:56.789', { birthday : '1995-06-18', nationality : 'Spain', height : 190 }, (333, 'ccc') );

INSERT INTO all_types_no_counter_no_duration (aascii, abigint, ablob, aboolean, adecimal, adouble, afloat, ainet, aint, atext, atimestamp, atimeuuid, auuid, avarchar, avarint, alist, amap, aset, atinyint, asmallint, adate, atime, afrozen_udt, atuple)
VALUES ('tzach', 2002, bigintAsBlob(3), true, 10 , 10.10, 11.11 , '204.202.130.223', 17, 'text' ,'2016-08-30 12:34:56.789', maxTimeuuid('2013-01-01 00:05+0000'), 123e4567-e89b-12d3-a456-426655440000, 'tzachvarchar', 17, [1,2,3], {1 : 2}, {1,2,3,4}, 8, 16,
'2016-09-30', '12:14:56.789', { birthday : '1993-06-18', nationality : 'New Zealand', height : 180 }, (111, 'aaa') );

INSERT INTO all_types_no_counter_no_duration (aascii, abigint, ablob, aboolean, adecimal, adouble, afloat, ainet, aint, atext, atimestamp, atimeuuid, auuid, avarchar, avarint, alist, amap, aset, atinyint, asmallint, adate, atime, afrozen_udt, atuple)
VALUES ('livyatan', 2003, bigintAsBlob(3), true, 10 , 10.10, 11.11 , '204.202.130.223', 17, 'text' ,'2016-08-30 12:23:34.567', maxTimeuuid('2013-01-01 00:05+0000'), 123e4567-e89b-12d3-a456-426655440000, 'tzachvarchar', 17, [1,2,3], {1 : 2}, {1,2,3,4}, 16, 512,
'2016-08-30', '12:34:56.789', { birthday : '1995-06-18', nationality : 'Spain', height : 190 }, (333, 'ccc') );

Uploaded table, using Scylla 1.7.1 sstable loader -> timestamp value doesn't present millisec numbers

Cassandra 3.10
cqlsh:mykeyspace> select atimestamp,abigint from all_types_no_counter_no_duration ;
atimestamp | abigint
---------------------------------+---------
2016-08-30 14:01:55.000000+0000 | 1999
2016-08-30 07:01:00.000000+0000 | 2000
2016-08-30 12:34:56.789000+0000 | 2002
2016-08-30 07:01:00.000000+0000 | 2001
2016-08-30 12:23:34.567000+0000 | 2003

(5 rows)

Scylla 1.7.1 -> millisec are not displayed in our CQL client, though the binary value is still the same

cqlsh:mykeyspace> select atimestamp,abigint from all_types_no_counter_no_duration ;

atimestamp | abigint
--------------------------+---------
2016-08-30 14:01:55+0000 | 1999
2016-08-30 07:01:00+0000 | 2000
2016-08-30 12:34:56+0000 | 2002
2016-08-30 07:01:00+0000 | 2001
2016-08-30 12:23:34+0000 | 2003

Cassandra 3.10
cqlsh:mykeyspace> select timestampasblob(atimestamp) from all_types_no_counter_no_duration ;
system.timestampasblob(atimestamp)
------------------------------------
0x00000156dbc1a038
0x00000156da4043e0
0x00000156db720095
0x00000156da4043e0
0x00000156db6797a7

(5 rows)

Scylla 1.7.1
cqlsh:mykeyspace> select timestampasblob(atimestamp) from all_types_no_counter_no_duration ;
system.timestampasblob(atimestamp)
------------------------------------
0x00000156dbc1a038
0x00000156da4043e0
0x00000156db720095
0x00000156da4043e0
0x00000156db6797a7

(5 rows)

Using the Cassandra 3.10 cqlsh client with ScyllaDB allows you to see the millisec numbers

cassandra-stress counter_write: the table Counter1 is not created automatically

cassandra-stress with counters creates only Standard1 table, but Counter1 table is not created.

[root@ip-172-30-0-39 ~]# /usr/bin/cassandra-stress counter_write n=1000
WARN 09:36:05 You listed localhost/0:0:0:0:0:0:0:1:9042 in your contact points, but it wasn't found in the control host's system.peers at startup
Connected to cluster: larisa-test-aws-scylla-db-cluster-4fb207b4, max pending requests per connection 128, max connections per host 8
Datatacenter: datacenter1; Host: localhost/127.0.0.1; Rack: rack1
Datatacenter: datacenter1; Host: /172.30.0.160; Rack: rack1
Created keyspaces. Sleeping 1s for propagation.
Sleeping 2s...
Warming up COUNTER_WRITE with 250 iterations...
Failed to connect over JMX; not collecting these stats
com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table counter1
at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.AbstractSession.prepare(AbstractSession.java:98)
at org.apache.cassandra.stress.util.JavaDriverClient.prepare(JavaDriverClient.java:101)
at org.apache.cassandra.stress.operations.predefined.CqlOperation$JavaDriverWrapper.createPreparedStatement(CqlOperation.java:311)
at org.apache.cassandra.stress.operations.predefined.CqlOperation.run(CqlOperation.java:74)
at org.apache.cassandra.stress.operations.predefined.CqlOperation.run(CqlOperation.java:106)
at org.apache.cassandra.stress.operations.predefined.CqlOperation.run(CqlOperation.java:258)
at org.apache.cassandra.stress.StressAction$Consumer.run(StressAction.java:321)
Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table counter1
at com.datastax.driver.core.Responses$Error.asException(Responses.java:136)
at com.datastax.driver.core.SessionManager$4.apply(SessionManager.java:220)
at com.datastax.driver.core.SessionManager$4.apply(SessionManager.java:196)
at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:906)
at com.google.common.util.concurrent.Futures$1$1.run(Futures.java:635)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

sstabledump exception on user-defined data type

CREATE TYPE name_type (firstname text, lastname text);
CREATE TYPE address_type (name frozen<name_type>, number int, street text, phones set);
CREATE TABLE testdatatype (
a ascii PRIMARY KEY,
...,
t frozen<address_type>,
u frozen<list<list<address_type>>>,
...,
)
insert data:
{name: {firstname: 'name1', lastname: 'last1'}, number: 1, street: 'street 1', phones: {'1111 2222', '3333 4444'}}

sstabledump fails with exception:
Exception in thread "main" org.apache.cassandra.exceptions.InvalidRequestException: Unknown type ks.address_type
at org.apache.cassandra.cql3.CQL3Type$Raw$RawUT.prepare(CQL3Type.java:745)
at org.apache.cassandra.cql3.CQL3Type$Raw.prepareInternal(CQL3Type.java:533)
at org.apache.cassandra.schema.CQLTypeParser.parse(CQLTypeParser.java:53)
at org.apache.cassandra.schema.SchemaKeyspace.createColumnFromRow(SchemaKeyspace.java:1011)
at org.apache.cassandra.schema.SchemaKeyspace.lambda$fetchColumns$12(SchemaKeyspace.java:995)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.apache.cassandra.schema.SchemaKeyspace.fetchColumns(SchemaKeyspace.java:995)
at org.apache.cassandra.schema.SchemaKeyspace.fetchTable(SchemaKeyspace.java:949)
at org.apache.cassandra.schema.SchemaKeyspace.fetchTables(SchemaKeyspace.java:928)
at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspace(SchemaKeyspace.java:891)
at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspacesWithout(SchemaKeyspace.java:868)
at org.apache.cassandra.schema.SchemaKeyspace.fetchNonSystemKeyspaces(SchemaKeyspace.java:856)
at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:136)
at org.apache.cassandra.config.Schema.loadFromDiskForTool(Schema.java:145)
at com.scylladb.tools.SSTableExport.metadataFromSSTable(SSTableExport.java:26)
at org.apache.cassandra.tools.SSTableExport.run(SSTableExport.java:192)
at com.scylladb.tools.SSTableExport.main(SSTableExport.java:37)
^CKeyboardInterrupt: KeyboardInterrupt()

Improve cqlsh default host

By default, cqlsh connects to localhost, but on a configured cluster this is wrong.

If we make cqlsh look for scylla.yaml, parse it if it exists, and connect to listen_address (and native_transport_port), the user experience will be happier.

After running sstabledump as root the owner of Summary.db file was changed

drwx------. 3 larisau larisau 4096 Mar 28 14:27 .
drwx------. 3 larisau larisau 4096 Mar 28 14:11 ..
-rw-r--r--. 1 larisau larisau 66 Mar 28 14:27 client_warnings-test-ka-1-CompressionInfo.db
-rw-r--r--. 1 larisau larisau 74 Mar 28 14:27 client_warnings-test-ka-1-Data.db
-rw-r--r--. 1 larisau larisau 10 Mar 28 14:27 client_warnings-test-ka-1-Digest.sha1
-rw-r--r--. 1 larisau larisau 16 Mar 28 14:27 client_warnings-test-ka-1-Filter.db
-rw-r--r--. 1 larisau larisau 36 Mar 28 14:27 client_warnings-test-ka-1-Index.db
-rw-r--r--. 1 larisau larisau 38 Mar 28 14:27 client_warnings-test-ka-1-Scylla.db
-rw-r--r--. 1 larisau larisau 4446 Mar 28 14:27 client_warnings-test-ka-1-Statistics.db
-rw-r--r--. 1 larisau larisau 56 Mar 28 14:27 client_warnings-test-ka-1-Summary.db
-rw-r--r--. 1 larisau larisau 101 Mar 28 14:27 client_warnings-test-ka-1-TOC.txt

[root@larisa ~]# /home/larisau/dev/scylla-tools-java/tools/bin/sstabledump /home/larisau/.ccm/scylla-stress/node1/data/client_warnings/test-4e3323d013a711e79f77000000000000/client_warnings-test-ka-1-Data.db
[
{
"partition" : {
"key" : [ "1" ],
"position" : 0
},
"rows" : [
{
"type" : "row",
"position" : 62,
"liveness_info" : { "tstamp" : "2017-03-28T11:12:31.771908Z" },
"cells" : [
{ "name" : "val", "value" : "aaa", "tstamp" : "2017-03-28T11:13:36.701207Z" }
]
}
]
},
{
"partition" : {
"key" : [ "2" ],
"position" : 62
},
"rows" : [
{
"type" : "row",
"position" : 124,
"liveness_info" : { "tstamp" : "2017-03-28T11:12:31.771908Z" },
"cells" : [
{ "name" : "val", "value" : "bbb", "tstamp" : "2017-03-28T11:13:36.701207Z" }
]
}
]
}
][root@larisa ~]# ls -la /home/larisau/.ccm/scylla-stress/node1/data/client_warnings/test-4e3323d013a711e79f77000000000000/
total 52
drwx------. 3 larisau larisau 4096 Mar 28 16:35 .
drwx------. 3 larisau larisau 4096 Mar 28 14:11 ..
-rw-r--r--. 1 larisau larisau 66 Mar 28 14:27 client_warnings-test-ka-1-CompressionInfo.db
-rw-r--r--. 1 larisau larisau 74 Mar 28 14:27 client_warnings-test-ka-1-Data.db
-rw-r--r--. 1 larisau larisau 10 Mar 28 14:27 client_warnings-test-ka-1-Digest.sha1
-rw-r--r--. 1 larisau larisau 16 Mar 28 14:27 client_warnings-test-ka-1-Filter.db
-rw-r--r--. 1 larisau larisau 36 Mar 28 14:27 client_warnings-test-ka-1-Index.db
-rw-r--r--. 1 larisau larisau 38 Mar 28 14:27 client_warnings-test-ka-1-Scylla.db
-rw-r--r--. 1 larisau larisau 4446 Mar 28 14:27 client_warnings-test-ka-1-Statistics.db
-rw-r--r--. 1 root root 72 Mar 28 16:35 client_warnings-test-ka-1-Summary.db
-rw-r--r--. 1 larisau larisau 101 Mar 28 14:27 client_warnings-test-ka-1-TOC.txt
drwx------. 2 larisau larisau 4096 Mar 28 14:11 upload

conflicts in scylla-tools when downgrade 2.0->1.7.x

steps:

  1. upgrade 1.7.2-> 2.0 latest
echo "[scylla]
name=Scylla for Centos $releasever - $basearch
baseurl=http://downloads.scylladb.com/rpm/unstable/centos/branch-2.0/latest/scylla/\$releasever/\$basearch/
enabled=1
gpgcheck=0

[scylla-generic]
name=Scylla for centos $releasever
baseurl=http://downloads.scylladb.com/rpm/unstable/centos/branch-2.0/latest/scylla/\$releasever/noarch/
enabled=1
gpgcheck=0

[scylla-3rdparty]
name=Scylla 3rdParty for Centos $releasever - $basearch
baseurl=http://downloads.scylladb.com/rpm/unstable/centos/branch-2.0/latest/3rdparty/\$releasever/\$basearch/
enabled=1
gpgcheck=0

[scylla-3rdparty-generic]
name=Scylla 3rdParty for Centos $releasever
baseurl=http://downloads.scylladb.com/rpm/unstable/centos/branch-2.0/latest/3rdparty/\$releasever\/noarch/
enabled=1
gpgcheck=0" > /tmp/scylla.repo

sudo cp /etc/yum.repos.d/scylla.repo ~/scylla.repo-backup
sudo cp /tmp/scylla.repo /etc/yum.repos.d/scylla.repo
            # backup the data
sudo cp /etc/scylla/scylla.yaml /etc/scylla/scylla.yaml-backup
sudo nodetool snapshot
sudo chown root.root /etc/yum.repos.d/scylla.repo
sudo chmod 644 /etc/yum.repos.d/scylla.repo
sudo yum clean all
sudo yum install scylla scylla-server scylla-jmx scylla-tools scylla-conf scylla-kernel-conf scylla-debuginfo -y
        # flush all memtables to SSTables
sudo nodetool drain
sudo systemctl restart scylla-server.service
#        node.wait_db_up(verbose=True)
rpm -qa scylla-server
  1. then try to downgrade till latest 1.7:
rpm -qa scylla-server
sudo cp ~/scylla.repo-backup /etc/yum.repos.d/scylla.repo
# backup the data
nodetool snapshot
sudo chown root.root /etc/yum.repos.d/scylla.repo
sudo chmod 644 /etc/yum.repos.d/scylla.repo
sudo yum clean all
sudo yum downgrade scylla scylla-server scylla-jmx scylla-tools scylla-conf scylla-kernel-conf -y

result:

Transaction check error:
  file /usr/share/scylla/cassandra/apache-cassandra-3.0.8-SNAPSHOT.jar from install of scylla-tools-1.7.3-20170719.ca9c263.el7.centos.noarch conflicts with file from package scylla-tools-core-2.0.rc1-20170723.8e1ef86.el7.centos.noarch
  file /usr/share/scylla/cassandra/apache-cassandra-thrift-3.0.8-SNAPSHOT.jar from install of scylla-tools-1.7.3-20170719.ca9c263.el7.centos.noarch conflicts with file from package scylla-tools-core-2.0.rc1-20170723.8e1ef86.el7.centos.noarch
  file /usr/share/scylla/cassandra/cassandra.in.sh from install of scylla-tools-1.7.3-20170719.ca9c263.el7.centos.noarch conflicts with file from package scylla-tools-core-2.0.rc1-20170723.8e1ef86.el7.centos.noarch
  file /usr/share/scylla/cassandra/scylla-tools-3.0.8-SNAPSHOT.jar from install of scylla-tools-1.7.3-20170719.ca9c263.el7.centos.noarch conflicts with file from package scylla-tools-core-2.0.rc1-20170723.8e1ef86.el7.centos.noarch
  file /usr/share/scylla/cassandra/stress.jar from install of scylla-tools-1.7.3-20170719.ca9c263.el7.centos.noarch conflicts with file from package scylla-tools-core-2.0.rc1-20170723.8e1ef86.el7.centos.noarch

Error Summary

all commands and output https://gist.github.com/abvgedeika/18e63c9e556cb8bb7f1d39ed9ec6c375

package installation path of python scripts

Currently we installs filter_cassandra_attributes.py and cassandra_attributes.py under /usr/bin, and soon we add cqlsh.py to there.
But I think user doesn't call them directly from shell, it's indirectly invoked by other scripts.
Maybe it's better to move somewhere else, like /usr/share/scylla/cassandra/ which currently used for placing *.jar files and cassandra.in.sh.

establish more connections in cassandra-stress

In many occasions we are forced to run multiple clients not because there is a bottleneck in the client machine, but because the low number of connections.

Ideally, we would make the number of connections configurable, and then tune that. A change like this should find its way to the upstream cassandra-stress project.

Bonus point if we can have a wrapper script that somehow connects to the Scylla REST or other jmx metrics, finds out what is the number of shards, and opens as many connections as there are shards.

cassandra-stress: counter_write workload got stuck with small population seq

from: scylladb/scylladb#2790 (comment)
I will retest with laster scylla.

Installation details
Scylla version (or git commit hash): 1.7.4-0.20170726.ff643e3 2.0.rc4-0.20170903.6e6de34
Cluster size: 4
OS (RHEL/CentOS/Ubuntu/AWS AMI): CentOS7

Description
cassandra-stress got stuck after the total ops number reached to population seq.
If we use a short duration (such as 10s), it won't exit.

Prepare
Create keyspace2 (tables: counter1, standard1)

CREATE KEYSPACE IF NOT EXISTS keyspace2
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

CREATE TABLE IF NOT EXISTS keyspace2.counter1 (
key blob PRIMARY KEY,
"C0" counter,
"C1" counter,
"C2" counter,
"C3" counter,
"C4" counter
) WITH COMPACT STORAGE
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL","rows_per_partition":"ALL"}'
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
Result
No output from commandline, and raise an exception after some minutes.

$ cassandra-stress counter_write no-warmup cl=QUORUM duration=5m -schema 'replication(factor=1) compaction(strategy=DateTieredCompactionStrategy)' keyspace=keyspace2 -port jmx=6868 -mode cql3 native -rate threads=10 -pop seq=1..10000 -node 10.240.0.4
Connected to cluster: longevity-50gb-4d-amosread-db-cluster-76310bd4, max pending requests per connection 128, max connections per host 8
Datatacenter: datacenter1; Host: /10.240.0.30; Rack: rack1
Datatacenter: datacenter1; Host: /10.240.0.19; Rack: rack1
Datatacenter: datacenter1; Host: /10.240.0.4; Rack: rack1
Datatacenter: datacenter1; Host: /10.240.0.27; Rack: rack1
Created keyspaces. Sleeping 1s for propagation.
Sleeping 2s...
Running COUNTER_WRITE with 10 threads 5 minutes
Failed to connect over JMX; not collecting these stats
type, total ops, op/s, pk/s, row/s, mean, med, .95, .99, .999, max, time, stderr, errors, gc: #, max ms, sum ms, sdv ms, mb
total, 840, 840, 840, 840, 10.4, 3.6, 35.5, 87.1, 136.1, 136.1, 1.0, 0.00000, 0, 0, 0, 0, 0, 0
total, 1641, 767, 767, 767, 13.0, 9.7, 28.7, 209.9, 263.6, 263.6, 2.0, 0.04577, 0, 0, 0, 0, 0, 0
total, 3026, 1380, 1380, 1380, 7.2, 2.4, 22.0, 33.0, 44.0, 84.0, 3.0, 0.12653, 0, 0, 0, 0, 0, 0
total, 4213, 1133, 1133, 1133, 8.5, 9.3, 22.0, 32.6, 44.0, 65.1, 4.1, 0.09444, 0, 0, 0, 0, 0, 0
total, 5630, 1365, 1365, 1365, 7.5, 2.7, 22.0, 34.9, 76.0, 83.4, 5.1, 0.08485, 0, 0, 0, 0, 0, 0
total, 6626, 977, 977, 977, 10.2, 9.0, 26.5, 86.4, 122.9, 122.9, 6.2, 0.07556, 0, 0, 0, 0, 0, 0
total, 7659, 1020, 1020, 1020, 9.9, 10.2, 22.9, 45.9, 96.4, 102.6, 7.2, 0.06565, 0, 0, 0, 0, 0, 0
total, 9205, 1520, 1520, 1520, 6.6, 1.5, 21.9, 32.3, 46.1, 46.2, 8.2, 0.06942, 0, 0, 0, 0, 0, 0

java.lang.RuntimeException: Timed out waiting for a timer thread - seems one got stuck. Check GC/Heap size
at org.apache.cassandra.stress.util.Timing.snap(Timing.java:98)
at org.apache.cassandra.stress.StressMetrics.update(StressMetrics.java:156)
at org.apache.cassandra.stress.StressMetrics.access$300(StressMetrics.java:37)
at org.apache.cassandra.stress.StressMetrics$2.run(StressMetrics.java:104)
at java.lang.Thread.run(Thread.java:748)

fail to build scylla-tools-java (master branch), some files are missing

latest master: commit id: 270caff

I tried to build ami by scylla/dist/ami/build_ami.sh, but fail in building dependence scylla-tools-java rpm.
Error:

+ install -m755 bin/sstablekeys /home/amos/scylla/build/scylla-tools-java/build/rpmbuild/BUILDROOT/scylla-
tools-666.development-20170112.270caff.el7.centos.x86_64/usr/bin
install: cannot stat ‘bin/sstablekeys’: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.Pnwja1 (%install)

If those files were removed in master, the spec file also needs to be updated.
branch-1.6 of scylla-tools-java is fine, the files exist.

[amos@f25 scylla-tools-java]$ git whatchanged master|grep bin/sstablekeys$
:100755 100755 55b72d9... c0967ef... M	bin/sstablekeys
:100755 100755 77d2e64... 55b72d9... M	bin/sstablekeys
:100755 100755 77d2e64... fbf86e9... M	bin/sstablekeys
:100755 000000 77d2e64... 0000000... D	bin/sstablekeys
:100755 100755 9033881... b1f48fe... M	bin/sstablekeys
:100755 100755 34f3d1b... 8308b88... M	bin/sstablekeys
:100755 100755 9033881... 34f3d1b... M	bin/sstablekeys
:100755 100755 81cffd0... 32f0339... M	bin/sstablekeys
:100755 100755 4c87bb5... 81cffd0... M	bin/sstablekeys
:100755 100755 4c87bb5... 9829744... M	bin/sstablekeys
:100755 100755 3c2aa33... 4c87bb5... M	bin/sstablekeys
:100755 100755 ab4c121... 3c2aa33... M	bin/sstablekeys
:100644 100755 ab4c121... ab4c121... M	bin/sstablekeys
:000000 100644 0000000... ab4c121... A	bin/sstablekeys
[amos@f25 scylla-tools-java]$ git whatchanged origin/branch-1.6|grep bin/sstablekeys$
:100755 100755 77d2e64... fbf86e9... M	bin/sstablekeys
:100755 100755 9033881... b1f48fe... M	bin/sstablekeys
:100755 100755 34f3d1b... 8308b88... M	bin/sstablekeys
:100755 100755 9033881... 34f3d1b... M	bin/sstablekeys
:100755 100755 81cffd0... 32f0339... M	bin/sstablekeys
:100755 100755 4c87bb5... 81cffd0... M	bin/sstablekeys
:100755 100755 4c87bb5... 9829744... M	bin/sstablekeys
:100755 100755 3c2aa33... 4c87bb5... M	bin/sstablekeys
:100755 100755 ab4c121... 3c2aa33... M	bin/sstablekeys
:100644 100755 ab4c121... ab4c121... M	bin/sstablekeys
:000000 100644 0000000... ab4c121... A	bin/sstablekeys

nodetool prints help with no error message when it cannot connect to scylla-jmx

Version: scylla-tools-2.0.rc0-20170717.e83b7f0.el7.centos.noarch

Output:

$ nodetool status
usage: nodetool [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
        [(-pw <password> | --password <password>)] [(-p <port> | --port <port>)]
        [(-u <username> | --username <username>)] [(-h <host> | --host <host>)]
        <command> [<args>]

The most commonly used nodetool commands are:
    bootstrap             Monitor/manage node's bootstrap process
    cleanup               Triggers the immediate cleanup of keys no longer belonging to a node. By default, clean all keyspaces
    clearsnapshot         Remove the snapshot with the given name from the given keyspaces. If no snapshotName is specified we will remove all snapshots
    compact               Force a (major) compaction on one or more tables
    compactionhistory     Print history of compaction
    compactionstats       Print statistics on compactions
    decommission          Decommission the *node I am connecting to*
    describecluster       Print the name, snitch, partitioner and schema version of a cluster
    describering          Shows the token ranges info of a given keyspace
    disablebackup         Disable incremental backup
    disablebinary         Disable native transport (binary protocol)
    disablegossip         Disable gossip (effectively marking the node down)
    drain                 Drain the node (stop accepting writes and flush all tables)
    enablebackup          Enable incremental backup
    enablebinary          Reenable native transport (binary protocol)
    enablegossip          Reenable gossip
    flush                 Flush one or more tables
    getendpoints          Print the end points that owns the key
    getlogginglevels      Get the runtime logging levels
    gossipinfo            Shows the gossip information for the cluster
    help                  Display help information
    info                  Print node information (uptime, load, ...)
    listsnapshots         Lists all the snapshots along with the size on disk and true size.
    move                  Move node on the token ring to a new token
    netstats              Print network information on provided host (connecting node by default)
    proxyhistograms       Print statistic histograms for network operations
    rebuild               Rebuild data by streaming from other nodes (similarly to bootstrap)
    refresh               Load newly placed SSTables to the system without restart
    removenode            Show status of current node removal, force completion of pending removal or remove provided ID
    repair                Repair one or more tables
    ring                  Print information about the token ring
    setlogginglevel       Set the log level threshold for a given class. If both class and level are empty/null, it will reset to the initial configuration
    settraceprobability   Sets the probability for tracing any given request to value. 0 disables, 1 enables for all requests, 0 is the default
    snapshot              Take a snapshot of specified keyspaces or a snapshot of the specified table
    status                Print cluster information (state, load, IDs, ...)
    statusbackup          Status of incremental backup
    statusbinary          Status of native transport (binary protocol)
    statusgossip          Status of gossip
    stop                  Stop compaction
    tablehistograms       Print statistic histograms for a given table
    tablestats            Print statistics on tables
    version               Print cassandra version

See 'nodetool help <command>' for more information on a specific command.

versus:

nodetool -p 7199 status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens       Owns    Host ID                               Rack
UN  10.241.0.202  436.64 GB  256          ?       0a5612f4-4de5-445c-9c40-5e126cde2335  rack1
UN  10.241.0.203  600.84 GB  256          ?       b37cf858-19b5-42d1-964e-9654971bfffb  rack1
UN  10.241.0.210  491.49 GB  256          ?       0e0403ce-bf81-4d2a-8564-07b9ba6503e4  rack1
UL  10.24010.211  372.97 GB  256          ?       a9f424d4-dad4-490c-89f9-bfdbec935c0e  rack1

It doesn't immediately occur to one what the cause is.

On Ubuntu, 'ImportError: No module named yaml' may occurs because dependencies is not enough for scylla-tools-core

When we install only scylla-tools-core, python-yaml will not install automatically.
Then we may get python ImportError because the package isn't installed.
So the dependency should move from scylla-tools to scylla-tools-core.

$  /usr/bin/scylla-sstableloader
Traceback (most recent call last):
  File "/usr/bin/filter_cassandra_attributes.py", line 4, in <module>
    from yaml import load, dump, load_all
ImportError: No module named yaml
Missing sstable directory argument
usage: sstableloader [options] <dir_path>

Bulk load the sstables found in the directory <dir_path> to the configured
cluster.The parent directories of <dir_path> are used as the target
keyspace/table name. So for instance, to load an sstable named
Standard1-g-1-Data.db into Keyspace1/Standard1, you will need to have the
files Standard1-g-1-Data.db and Standard1-g-1-Index.db into a directory
/path/to/Keyspace1/Standard1/.
 -alg,--ssl-alg <ALGORITHM>                          Client SSL: algorithm
                                                     (default: SunX509)
 -b,--use-batch                                      batch updates for
                                                     same partition key.
 -ciphers,--ssl-ciphers <CIPHER-SUITES>              Client SSL:
                                                     comma-separated list of encryption suites to use
 -cph,--connections-per-host <connectionsPerHost>    number of concurrent
                                                     connections-per-host.
 -d,--nodes <initial hosts>                          Required. try to
                                                     connect to these hosts (comma separated) initially for ring information
 -f,--conf-path <path to config file>                cassandra.yaml file
                                                     path for streaming throughput and client/server SSL.
 -g,--ignore-missing-columns <COLUMN NAMES...>       ignore named missing
                                                     columns in tables
 -h,--help                                           display this help
                                                     message
 -i,--ignore <NODES>                                 don't stream to this
                                                     (comma separated) list of nodes
 -ks,--keystore <KEYSTORE>                           Client SSL: full path
                                                     to keystore
 -kspw,--keystore-password <KEYSTORE-PASSWORD>       Client SSL: password
                                                     of the keystore
    --no-progress                                    don't display
                                                     progress
 -p,--port <port>                                    port used for
                                                     connections (default 9042)
 -prtcl,--ssl-protocol <PROTOCOL>                    Client SSL:
                                                     connections protocol to use (default: TLS)
 -pw,--password <password>                           password for
                                                     cassandra authentication
 -s,--ssl <SSL>                                      Use SSL connection(s)
 -sim,--simulate                                     simulate. Only print
                                                     CQL generated
 -st,--store-type <STORE-TYPE>                       Client SSL: type of
                                                     store
 -t,--throttle <throttle>                            throttle speed in
                                                     Mbits (default unlimited)
 -ts,--truststore <TRUSTSTORE>                       Client SSL: full path
                                                     to truststore
 -tspw,--truststore-password <TRUSTSTORE-PASSWORD>   Client SSL: password
                                                     of the truststore
 -u,--username <username>                            username for
                                                     cassandra authentication
 -v,--verbose                                        verbose output
 -x,--use-prepared                                   prepared statements

You can provide cassandra.yaml file with -f command line option to set up
streaming throughput, client and server encryption options. Only
stream_throughput_outbound_megabits_per_sec, server_encryption_options and
client_encryption_options are read from yaml. You can override options
read from cassandra.yaml with corresponding command line options.

Scylla-JMX is not logging all messages it could

After observing logs of scylla-jmx, I started to notice
the following message:

Running '/bin/journalctl --unit scylla-jmx.service'
[stdout] -- Logs begin at Sat 2016-01-23 10:02:51 UTC, end at Sat 2016-01-23 10:07:26 UTC. --
[stdout] Jan 23 10:05:15 ip-172-30-0-9 systemd[1]: Started Scylla JMX.
[stdout] Jan 23 10:05:15 ip-172-30-0-9 systemd[1]: Starting Scylla JMX...
[stdout] Jan 23 10:05:16 ip-172-30-0-9 scylla-jmx[2685]: Using config file: /etc/scylla/scylla.yaml
[stdout] Jan 23 10:05:22 ip-172-30-0-9 scylla-jmx[2685]: Connecting to http://127.0.0.1:10000
[stdout] Jan 23 10:05:22 ip-172-30-0-9 scylla-jmx[2685]: Starting the JMX server
[stdout] Jan 23 10:05:29 ip-172-30-0-9 scylla-jmx[2685]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[stdout] Jan 23 10:05:29 ip-172-30-0-9 scylla-jmx[2685]: SLF4J: Defaulting to no-operation (NOP) logger implementation
[stdout] Jan 23 10:05:29 ip-172-30-0-9 scylla-jmx[2685]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

This is related to jar dependency misconfiguration. I'll send a patch for this.

running sstablelevelreset as root caused the next running of the tool to fail with exception

  1. create cluster
  2. start cluster, run stress tool, then stop the cluster
  3. run as root: sstablelevelreset --really-reset keyspace1 standard1
    got error:
    'ColumnFamily not found: keyspace1/standard1\n'
  4. run the same as user:

$ ~/dev/scylla/resources/cassandra/tools/bin/sstablelevelreset --really-reset keyspace1 standard1
ERROR 14:29:50 [/home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log] was not completed, trying to abort it now
ERROR 14:29:50 Failed to abort [/home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log]
java.lang.RuntimeException: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:557) ~[main/:na]
at org.apache.cassandra.io.util.FileUtils.appendAndSync(FileUtils.java:538) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplica.append(LogReplica.java:66) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplicaSet.lambda$null$2(LogReplicaSet.java:186) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplicaSet.append(LogReplicaSet.java:186) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogFile.addRecord(LogFile.java:301) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogFile.abort(LogFile.java:255) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:98) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogTransaction$TransactionTidier.run(LogTransaction.java:247) [main/:na]
at org.apache.cassandra.db.lifecycle.LogTransaction$TransactionTidier.tidy(LogTransaction.java:231) [main/:na]
at org.apache.cassandra.utils.concurrent.Ref$GlobalState.release(Ref.java:320) [main/:na]
at org.apache.cassandra.utils.concurrent.Ref$State.ensureReleased(Ref.java:198) [main/:na]
at org.apache.cassandra.utils.concurrent.Ref.ensureReleased(Ref.java:118) [main/:na]
at org.apache.cassandra.db.lifecycle.LogTransaction.complete(LogTransaction.java:359) [main/:na]
at org.apache.cassandra.db.lifecycle.LogTransaction.doAbort(LogTransaction.java:376) [main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144) [main/:na]
at org.apache.cassandra.db.lifecycle.LifecycleTransaction.doAbort(LifecycleTransaction.java:234) [main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144) [main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:193) [main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.close(Transactional.java:158) [main/:na]
at org.apache.cassandra.db.Memtable.createFlushWriter(Memtable.java:449) [main/:na]
at org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:371) [main/:na]
at org.apache.cassandra.db.Memtable.flush(Memtable.java:332) [main/:na]
at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1063) [main/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[na:1.8.0_121]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_121]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_121]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_121]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[na:1.8.0_121]
at java.nio.file.Files.newOutputStream(Files.java:216) ~[na:1.8.0_121]
at java.nio.file.Files.write(Files.java:3351) ~[na:1.8.0_121]
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:550) ~[main/:na]
... 30 common frames omitted
ERROR 14:29:50 Unable to delete /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log as it does not exist
ERROR 14:29:50 Error in ThreadPoolExecutor
java.lang.RuntimeException: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:557) ~[main/:na]
at org.apache.cassandra.io.util.FileUtils.appendAndSync(FileUtils.java:538) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplica.append(LogReplica.java:66) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplicaSet.lambda$null$2(LogReplicaSet.java:186) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogReplicaSet.append(LogReplicaSet.java:186) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogFile.addRecord(LogFile.java:301) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogFile.abort(LogFile.java:255) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103) ~[main/:na]
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:98) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LogTransaction.doAbort(LogTransaction.java:376) ~[main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144) ~[main/:na]
at org.apache.cassandra.db.lifecycle.LifecycleTransaction.doAbort(LifecycleTransaction.java:234) ~[main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144) ~[main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:193) ~[main/:na]
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.close(Transactional.java:158) ~[main/:na]
at org.apache.cassandra.db.Memtable.createFlushWriter(Memtable.java:449) ~[main/:na]
at org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:371) ~[main/:na]
at org.apache.cassandra.db.Memtable.flush(Memtable.java:332) ~[main/:na]
at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1063) ~[main/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[na:1.8.0_121]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_121]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_121]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[na:1.8.0_121]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[na:1.8.0_121]
at java.nio.file.Files.newOutputStream(Files.java:216) ~[na:1.8.0_121]
at java.nio.file.Files.write(Files.java:3351) ~[na:1.8.0_121]
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:550) ~[main/:na]
... 24 common frames omitted
Exception in thread "MemtableFlushWriter:2" java.lang.RuntimeException: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:557)
at org.apache.cassandra.io.util.FileUtils.appendAndSync(FileUtils.java:538)
at org.apache.cassandra.db.lifecycle.LogReplica.append(LogReplica.java:66)
at org.apache.cassandra.db.lifecycle.LogReplicaSet.lambda$null$2(LogReplicaSet.java:186)
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113)
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103)
at org.apache.cassandra.db.lifecycle.LogReplicaSet.append(LogReplicaSet.java:186)
at org.apache.cassandra.db.lifecycle.LogFile.addRecord(LogFile.java:301)
at org.apache.cassandra.db.lifecycle.LogFile.abort(LogFile.java:255)
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:113)
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:103)
at org.apache.cassandra.utils.Throwables.perform(Throwables.java:98)
at org.apache.cassandra.db.lifecycle.LogTransaction.doAbort(LogTransaction.java:376)
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144)
at org.apache.cassandra.db.lifecycle.LifecycleTransaction.doAbort(LifecycleTransaction.java:234)
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:144)
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.abort(Transactional.java:193)
at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.close(Transactional.java:158)
at org.apache.cassandra.db.Memtable.createFlushWriter(Memtable.java:449)
at org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:371)
at org.apache.cassandra.db.Memtable.flush(Memtable.java:332)
at org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1063)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.AccessDeniedException: /home/larisau/dev/scylla-tools-java/data/data/system/local-7ad54392bcdd35a684174e047860b377/mc_txn_flush_298c1900-1943-11e7-889a-8d0c97517e62.log
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
at java.nio.file.Files.newOutputStream(Files.java:216)
at java.nio.file.Files.write(Files.java:3351)
at org.apache.cassandra.io.util.FileUtils.write(FileUtils.java:550)

sstableloader ignores range tombstones that signify ranges

sstableloader assumes that a range tombstone signifies a clustering row prefix, but that is not always the case.

For example, with

CREATE TABLE tab (
    pk int,
    a int,
    b int,
    v int,
    PRIMARY KEY (pk, a, b)
);

DELETE FROM tab WHERE pk = 1 AND a = 3;
DELETE FROM tab WHERE pk = 1 AND a = 3 AND b = 4;

we get three range tombstones, two of which are really ranges:

[(3), (3, 4))
[(3, 4), (3, 4)]
((3, 4), (3)]

sstabledump: some json data is unreadable

v frozen<map<map<int,int>,set>>

OrderedMapSerializedKey([(OrderedMapSerializedKey([(1, 1), (2, 2)]), SortedSet([u'1', u'2', u'3']))])

w frozen<set<set>>

SortedSet([SortedSet(['127.0.0.1']), SortedSet(['127.0.0.1', '127.0.0.2'])])

The first('v') is unreadable, the second('w') is empty.

json:
{ u'name': u'v', u'value': u'00000001000000240000000200000004000000010000000400000001000000040000000200000004000000020000001300000003000000013100000001320000000133'},
{ u'name': u'w', u'value': u''},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.