You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by 鄢来琼 <la...@gtafe.com> on 2015/03/16 04:11:26 UTC

Is Table created in all the nodes if the default consistency level used

Could you tell me whether the meta data of the new table are build in all the nodes after execute the following statement.

cassandra_session.execute_async(

“““CREATE TABLE Table_test(

      ID uuid,

      Time timestamp,

      Value double,

      Date timestamp,

      PRIMARY KEY ((ID,Date), Time)

) WITH COMPACT STORAGE;
”””
)

As I know, the system keyspace is used to store the meta data, but the strategy is localStrategy, which only store meta data of local node.
So I want to know whether table is created in all the nodes, should I add consistency_level setting to the above statement to make sure
“create table” will be executed in all the nodes?
Thanks.

Peter


Re: Is Table created in all the nodes if the default consistency level used

Posted by daemeon reiydelle <da...@gmail.com>.
If you want to guarantee that the data is written to all nodes before the
code returns, then yes you have to use "consistency all". Otherwise there
is a small risk of outdated data being served if a node goes offline longer
than hints timeouts.

Somewhat looser options that can assure multiple copies are written, as you
probably know, are quorum or a hard coded value. This applies to a typical
installation with a substantial number of nodes of course, not a small 2-3
node cluster.

I am curious why localStrategy when you have such concerns about data
consistency that you want to assure all nodes get data written. Can you
elaborate on your use case?



*.......*






*“Life should not be a journey to the grave with the intention of arriving
safely in apretty and well preserved body, but rather to skid in broadside
in a cloud of smoke,thoroughly used up, totally worn out, and loudly
proclaiming “Wow! What a Ride!” - Hunter ThompsonDaemeon C.M. ReiydelleUSA
(+1) 415.501.0198London (+44) (0) 20 8144 9872*

On Sun, Mar 15, 2015 at 8:11 PM, 鄢来琼 <la...@gtafe.com> wrote:

>  Could you tell me whether the meta data of the new table are build in
> all the nodes after execute the following statement.
>
>
>
> *cassandra_session.execute_async(*
>
> *“““**CREATE TABLE Table_test(*
>
> *      ID uuid,*
>
> *      Time timestamp,*
>
> *      Value double,*
>
> *      Date timestamp,*
>
> *      PRIMARY KEY ((ID,Date), Time)*
>
> *) WITH COMPACT STORAGE;*
>
> *”””*
>
> *)*
>
>
>
> As I know, the system keyspace is used to store the meta data, but the
> strategy is localStrategy, which only store meta data of local node.
>
> So I want to know whether table is created in all the nodes, should I add
> consistency_level setting to the above statement to make sure
>
> “create table” will be executed in all the nodes?
>
> Thanks.
>
>
>
> Peter
>
>
>