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

Jonathan Ellis commented on CASSANDRA-5064:
-------------------------------------------

bq. Do we agree that it doesn't do the "change maybeSwitchMemtable to 
unconditionally switch"?

Here's the new core of switchMemtable:

{code}
.       for (ColumnFamilyStore cfs : concatWithIndexes())
        {
            Memtable mt = cfs.data.switchMemtable();
            if ((!mt.isClean()))
                memtables.add(mt);
        }
{code}

bq. I see nothing that prevents flushing the same memtable multiple times.

What prevents it is that DataTracker.switchMemtable is atomic and will only 
return a given memtable once.  (So, if we have a whole bunch of threads calling 
forceFlush at once, we'll probably switch out a few empty ones, but that is the 
end of the extra work we do.)

bq. for counter this is a bug

Ugh, counters again.  Have to think about this.

bq. I also don't think using reference counting really makes this issue simpler.

I do. :)  We're net -120 lines of fairly tricky code.  We've had multiple bugs 
from not dealing with switchlock correctly (CASSANDRA-3712 and the flushing 
code from CASSANDRA-3411, off the top of my head).

bq. I'm really doubtful that changing such an important piece of code just 
before a release is a good idea

I'll buy that.
                
> 'Alter table' when it includes collections makes cqlsh hang
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-5064
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5064
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.2.0 beta 3, 1.2.0
>         Environment: Ubuntu 12.04 LTS
> 3.2.0-23-virtual
>            Reporter: Ryan McGuire
>            Assignee: Sylvain Lebresne
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: 5064.txt, 5064-v2.txt
>
>
> Having just installed 1.2.0-beta3 issue the following CQL into cqlsh:
> {code}
> drop keyspace test;
> create keyspace test with replication = {
>           'class': 'SimpleStrategy',
>           'replication_factor': '1'
>         };
> use test;
> create table users (
>             user_id text PRIMARY KEY,
>             first_name text,
>             last_name text,
>             email_addresses set<text>
>         );
> alter table users add mailing_address_lines list<text>;
> {code}
> As soon as you issue the alter table statement cqlsh hangs, and the java 
> process hosting Cassandra consumes 100% of a single core's CPU.
> If the alter table doesn't include a collection, it runs fine.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to