You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jeff Jirsa (JIRA)" <ji...@apache.org> on 2015/01/28 19:01:37 UTC

[jira] [Comment Edited] (CASSANDRA-8694) Repair of empty keyspace hangs rather than ignoring the request

    [ https://issues.apache.org/jira/browse/CASSANDRA-8694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14295470#comment-14295470 ] 

Jeff Jirsa edited comment on CASSANDRA-8694 at 1/28/15 6:01 PM:
----------------------------------------------------------------

There's already a check for empty cfnames in repair.RepairSession:

        assert cfnames.length > 0 : "Repairing no column families seems pointless, doesn't it";

We can check cfnames.length prior to getting there to prevent the hang

bash-3.2# ccm create --install-dir ./cassandra/ --nodes 3 --start 300snapshot
Current cluster is now: 300snapshot
bash-3.2# 
bash-3.2# ccm node1 nodetool -- repair
[2015-01-28 09:28:18,899] Nothing to repair for keyspace 'system_auth'
[2015-01-28 09:28:18,904] Starting repair command #1, repairing keyspace system_traces with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 2)
[2015-01-28 09:28:18,954] Repair session 0cd1c9d0-a713-11e4-a05c-4f27f9294abb for range (3074457345618258602,-9223372036854775808] finished
[2015-01-28 09:28:18,968] Repair session 0cd488f0-a713-11e4-a05c-4f27f9294abb for range (-3074457345618258603,3074457345618258602] finished
[2015-01-28 09:28:18,972] Repair command #1 finished in 0 seconds
bash-3.2# ccm node1 cqlsh
Connected to 300snapshot at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.0-SNAPSHOT | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> create KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2}; create KEYSPACE test_with_table WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2}; use test_with_table; CREATE TABLE users (   user_name varchar PRIMARY KEY,   password varchar,   gender varchar,   session_token varchar,   state varchar,   birth_year bigint );
cqlsh:test_with_table> ^D
bash-3.2# ccm node1 nodetool -- repair
[2015-01-28 09:28:36,803] Starting repair command #2, repairing keyspace test_with_table with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 2)
[2015-01-28 09:28:36,812] Repair session 177a5d70-a713-11e4-a05c-4f27f9294abb for range (3074457345618258602,-9223372036854775808] finished
[2015-01-28 09:28:36,814] Repair session 177a8480-a713-11e4-a05c-4f27f9294abb for range (-3074457345618258603,3074457345618258602] finished
[2015-01-28 09:28:36,815] Repair command #2 finished in 0 seconds
[2015-01-28 09:28:36,825] Starting repair command #3, repairing keyspace test with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 2)
[2015-01-28 09:28:36,829] Repair command #3 finished in 0 seconds
[2015-01-28 09:28:36,834] Nothing to repair for keyspace 'system_auth'
[2015-01-28 09:28:36,837] Starting repair command #4, repairing keyspace system_traces with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], # of ranges: 2)
[2015-01-28 09:28:36,848] Repair session 177fb4a0-a713-11e4-a05c-4f27f9294abb for range (3074457345618258602,-9223372036854775808] finished
[2015-01-28 09:28:36,853] Repair session 177fb4a1-a713-11e4-a05c-4f27f9294abb for range (-3074457345618258603,3074457345618258602] finished
[2015-01-28 09:28:36,855] Repair command #4 finished in 0 seconds


was (Author: jjirsa):
There's already a check for empty cfnames in repair.RepairSession:

        assert cfnames.length > 0 : "Repairing no column families seems pointless, doesn't it";

We can check cfnames.length prior to getting there to prevent the hang



> Repair of empty keyspace hangs rather than ignoring the request
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-8694
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8694
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Ryan McGuire
>            Priority: Minor
>         Attachments: cass-8694.patch
>
>
> Create a two node cluster, create a keyspace, don't create any tables. Initiate a repair:
> {code}
> 04:32 PM:~$ ccm create -v git:cassandra-2.1 test -n 2 -s
> Fetching Cassandra updates...
> Current cluster is now: test
> 04:33 PM:~$ ccm node1 cqlsh
> Connected to test at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.2-SNAPSHOT | CQL spec 3.2.0 | Native protocol v3]
> Use HELP for help.
> cqlsh> create KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2};
> cqlsh> 
> 04:34 PM:~$ ccm node1 nodetool -- repair
> [2015-01-27 16:34:11,741] Nothing to repair for keyspace 'system'
> [2015-01-27 16:34:11,748] Starting repair command #1, repairing 2 ranges for keyspace test (parallelism=SEQUENTIAL, full=true)
> {code}
> The repair hangs.
> Do the same thing but add a table, and the repair completes very quickly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)