cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Zlatanov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-995) restarting node crashes with NPE when, while replaying the commitlog, the cfMetaData is requested
Date Mon, 19 Apr 2010 16:43:51 GMT

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

Ted Zlatanov commented on CASSANDRA-995:
----------------------------------------

OK, I can prepare a proper test if you need it but this definitely causes the NPE and should
work with minor changes for you (makeOpenLoginClient and getLongAsBytes are really simple
helper methods).  I do "sudo /etc/init.d/cassandra stop; rm -rf *; sudo /etc/init.d/cassandra
start", run the test, then "sudo /etc/init.d/cassandra restart" and get the NPE I showed earlier.
 This is with today's SVN (r935659).

It definitely is a combination of the number of keyspaces and CFs together with the number
of inserts.  If I do less that 1000 iterations or if I define fewer CFs and keyspaces, the
problem doesn't happen on restart.  So it took me a long time to hunt it down.

            Client c = CClient.makeOpenLoginClient("myserver");
            List<CfDef> cfdefs = ImmutableList.of();
            c.system_add_keyspace(new KsDef("HB3-prod", "org.apache.cassandra.locator.RackUnawareStrategy",
2, "org.apache.cassandra.locator.EndPointSnitch", cfdefs));
            c.system_add_keyspace(new KsDef("CM", "org.apache.cassandra.locator.RackUnawareStrategy",
2, "org.apache.cassandra.locator.EndPointSnitch", cfdefs));
            c.system_add_column_family(new CfDef("HB3-prod", "Status").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            c.system_add_column_family(new CfDef("HB3-prod", "Property").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            c.system_add_column_family(new CfDef("HB3-prod", "Relationship").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            c.system_add_column_family(new CfDef("HB3-prod", "Analysis").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            c.system_add_column_family(new CfDef("HB3-prod", "Knowledge").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            c.system_add_column_family(new CfDef("CM", "Inventory").setColumn_type("Super").setComparator_type("LongType").setSubcomparator_type("BytesType").setKey_cache_size(20000).setRow_cache_size(0));
            List<Column> columns = ImmutableList.of(new Column("one".getBytes(), "data".getBytes(),
System.currentTimeMillis()* 1000), new Column("two".getBytes(), "more data".getBytes(), System.currentTimeMillis()*
1000));
            for (int i=0; i < 1000; i++)
            {
                List<Mutation> mutations = ImmutableList.of(new Mutation().setColumn_or_supercolumn(new
ColumnOrSuperColumn().setSuper_column(new SuperColumn(CClient.getLongAsBytes(System.currentTimeMillis()),
columns))));
                List<Mutation> mutations2 = ImmutableList.of(new Mutation().setColumn_or_supercolumn(new
ColumnOrSuperColumn().setSuper_column(new SuperColumn(CClient.getLongAsBytes(i%100), columns))));
                Map<String,List<Mutation>> mutes = ImmutableMap.of("Status", mutations,
"Property", mutations2);
                c.batch_mutate("HB3-prod", ImmutableMap.of(("test key longer now" + System.currentTimeMillis()).getBytes(),
mutes), ConsistencyLevel.ONE);
            }
            Out.out("Done!");


> restarting node crashes with NPE when, while replaying the commitlog, the cfMetaData
is requested
> -------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-995
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-995
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7
>         Environment: SVN rev 935070
>            Reporter: Ted Zlatanov
>            Assignee: Gary Dusbabek
>            Priority: Critical
>             Fix For: 0.7
>
>         Attachments: crashlog-995, run_1.txt, run_2.txt
>
>
> Removing the commitlog directory completely fixes this.   I can reliably reproduce it
by 1) starting and configuring a schema with one keyspace, one super CF with LongType supercolumns;
2) inserting data; 3) shutting down and restarting the node.
> Here's my schema expressed in cassidy.pl, should be obvious what the parameters are:
> ./cassidy.pl -server X -port Y -keyspace system 'kdefine test org.apache.cassandra.locator.RackUnawareStrategy
2 org.apache.cassandra.locator.EndPointSnitch'
> ./cassidy.pl -server X -port Y -keyspace test 'fdefine Status Super LongType BytesType
comment=statuschanges,row_cache_size=0,key_cache_size=20000'
> The problem seems to be related to CASSANDRA-44 as it happens when the CF metadata is
requested but I don't know what's causing it.
> 10/04/16 15:25:11 INFO commitlog.CommitLog: Replaying /home/cassandra/commitlog/CommitLog-1271449410100.log,
/home/cassandra/commitlog/CommitLog-1271449378151.log, /home/cassandra/commitlog/CommitLog-1271449415800.log
> java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:160)
> Caused by: java.lang.NullPointerException
>         at org.apache.cassandra.db.Table.<init>(Table.java:261)
>         at org.apache.cassandra.db.Table.open(Table.java:102)
>         at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:233)
>         at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:172)
>         at org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:104)
>         at org.apache.cassandra.thrift.CassandraDaemon.init(CassandraDaemon.java:151)
>         ... 5 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message