cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Motta (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-8143) Partitioner should not be accessed through StorageService
Date Thu, 03 Sep 2015 21:08:46 GMT


Paulo Motta commented on CASSANDRA-8143:

The assertion {{assert partitioner != null}} on {{CFMetadata}} initialization is making {{Schema}}
static initialization fail on client mode tools (such as sstableloader) with the following
java.lang.AssertionError: null
	at org.apache.cassandra.config.CFMetaData.<init>( ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.<init>( ~[main/:na]
	at org.apache.cassandra.config.CFMetaData$ ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.compile( ~[main/:na]
	at org.apache.cassandra.schema.SchemaKeyspace.compile( ~[main/:na]
	at org.apache.cassandra.schema.SchemaKeyspace.<clinit>( ~[main/:na]
	at org.apache.cassandra.config.Schema.<init>( ~[main/:na]
	at org.apache.cassandra.config.Schema.<clinit>( ~[main/:na]
	at org.apache.cassandra.utils.concurrent.Ref$GlobalState.release( ~[main/:na]
	at org.apache.cassandra.utils.concurrent.Ref$State.release( ~[main/:na]
	at org.apache.cassandra.utils.concurrent.Ref.release( [main/:na]
	at [main/:na]
	at [main/:na]
	at$ [guava-18.0.jar:na]
	at [guava-18.0.jar:na]
	at [guava-18.0.jar:na]
	at org.apache.cassandra.streaming.StreamResultFuture.maybeComplete(
	at org.apache.cassandra.streaming.StreamResultFuture.handleSessionComplete(
	at org.apache.cassandra.streaming.StreamSession.closeSession( [main/:na]
	at org.apache.cassandra.streaming.StreamSession.complete( [main/:na]
	at org.apache.cassandra.streaming.StreamSession.messageReceived( [main/:na]
	at org.apache.cassandra.streaming.ConnectionHandler$
	at [na:1.8.0_45]

The reason for this is that {{BulkLoader}} sets {{Config.setClientMode(true)}}, so {{DatabaseDescriptor}}
does not have a have partitioner set, and {{SystemKeyspace}} cannot statically initialize/compile
the system tables' {{CFMetadata}} because {{DatabaseDescriptor.getPartitioner()}} is null.

This failure can be reproduced by running the dtest {{sstable_generation_loading_test}}, however
it's not causing the test to fail because it's only affecting cleanup. However, the implementation
of CASSANDRA-9839 performs a {{Schema.instance.getColumnFamilyStoreInstance}} during {{SStableReader}}
initialization, so that test [is failing|]
is failing with {{NoClassDefFoundError}} because {{Schema}} cannot be initialized.

What's the best approach to solve this? If simple, I can add the fix in the context of CASSANDRA-9839.
1) Remove the {{partitioner != null}} assertion from {{CFMetadata}} initialization.
2) Perform the assertion only when {{Config.getClientMode() == false}}.
3) Set a default partitioner on {{DatabaseDescriptor}} when {{Config.getClientMode() == true}}.

> Partitioner should not be accessed through StorageService
> ---------------------------------------------------------
>                 Key: CASSANDRA-8143
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Branimir Lambov
>            Assignee: Branimir Lambov
>             Fix For: 3.0 beta 1
> The configured partitioner is no longer the only partitioner in use in the database,
as e.g. index tables use LocalPartitioner.
> To make sure the correct partitioner is used for each table, accesses of StorageService.getPartitioner()
should be replaced with retrieval of the CFS-specific partitioner.

This message was sent by Atlassian JIRA

View raw message