[ 
https://issues.apache.org/jira/browse/CASSANDRA-2950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Ellis updated CASSANDRA-2950:
--------------------------------------

    Attachment: 2950.txt

Ah, CASSANDRA-2419 keeps on giving...

bq. but we record CL "context" at time of flush in the sstable it makes, and we 
on replay we ignore any mutations from before that position.

The obvious problem with this is that the point of truncate is to blow away 
such sstables...  Patch attached.  Comment explains the core fix:

{noformat}
// Bonus complication: since we store replay position in sstable metadata,
// truncating those sstables means we will replay any CL segments from the
// beginning if we restart before they are discarded for normal reasons
// post-truncate.  So we need to (a) force a new segment so the currently
// active one can be discarded, and (b) flush *all* CFs so that unflushed
// data in others don't keep any pre-truncate CL segments alive.
{noformat}

Patch also fixes the bug in ReplayManagerTruncateTest that made it miss this.


> Data from truncated CF reappears after server restart
> -----------------------------------------------------
>
>                 Key: CASSANDRA-2950
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2950
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.8.0
>            Reporter: Cathy Daw
>            Assignee: Jonathan Ellis
>             Fix For: 0.8.4
>
>         Attachments: 2950.txt
>
>
> * Configure 3 node cluster
> * Ensure the java stress tool creates Keyspace1 with RF=3
> {code}
> // Run Stress Tool to generate 10 keys, 1 column
> stress --operation=INSERT -t 2 --num-keys=50 --columns=20 
> --consistency-level=QUORUM --average-size-values --replication-factor=3 
> --create-index=KEYS --nodes=cathy1,cathy2
> // Verify 50 keys in CLI
> use Keyspace1; 
> list Standard1; 
> // TRUNCATE CF in CLI
> use Keyspace1;
> truncate counter1;
> list counter1;
> // Run stress tool and verify creation of 1 key with 10 columns
> stress --operation=INSERT -t 2 --num-keys=1 --columns=10 
> --consistency-level=QUORUM --average-size-values --replication-factor=3 
> --create-index=KEYS --nodes=cathy1,cathy2
> // Verify 1 key in CLI
> use Keyspace1; 
> list Standard1; 
> // Restart all three nodes
> // You will see 51 keys in CLI
> use Keyspace1; 
> list Standard1; 
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to