You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Alain Vandendorpe <al...@tapstream.com> on 2014/11/17 21:04:35 UTC
Deduplicating data on a node (RF=1)
Hey all,
For legacy reasons we're living with Cassandra 2.0.10 in an RF=1 setup.
This is being moved away from ASAP. In the meantime, adding a node recently
encountered a Stream Failed error (http://pastie.org/9725846). Cassandra
restarted and it seemingly restarted streaming from zero, without having
removed the failed stream's data.
With bootstrapping and initial compactions finished that node now has what
seems to be duplicate data, with almost exactly 2x the expected disk usage.
CQL returns correct results but we depend on the ability to directly read
the SSTable files (hence also RF=1.)
Would anyone have suggestions on a good way to resolve this?
Thanks,
Alain
Re: Deduplicating data on a node (RF=1)
Posted by Robert Coli <rc...@eventbrite.com>.
On Tue, Nov 18, 2014 at 10:04 AM, Alain Vandendorpe <al...@tapstream.com>
wrote:
> Rob - thanks for that, I was wondering whether either of those would
> successfully deduplicate the data. We were hypothesizing that a
> decommission would merely stream the duplicates out as well as though they
> were valid data - is this not the case?
>
That's a good question and actually your hypothesis is correct, so that is
not in fact a solution. D'oh! :D
After some discussion just now a colleague is suggesting we force them to
> L0[1] - would you agree this should be equivalent to option 2, albeit with
> downtime?
>
Yes, I think your colleague's suggestion is the only possible LCS
equivalent of option 2.
Hopefully you are in a version in which it is easy to set the LCS level of
SSTables, and have plenty of spare iops..
=Rob
Re: Deduplicating data on a node (RF=1)
Posted by Alain Vandendorpe <al...@tapstream.com>.
Thanks all - a little clarification:
- The node has fully joined at this point with the duplicates
- Cleanup has been run on older nodes
- Currently using LCS
Rob - thanks for that, I was wondering whether either of those would
successfully deduplicate the data. We were hypothesizing that a
decommission would merely stream the duplicates out as well as though they
were valid data - is this not the case?
After some discussion just now a colleague is suggesting we force them to
L0[1] - would you agree this should be equivalent to option 2, albeit with
downtime?
Cheers,
Alain
[1] https://issues.apache.org/jira/browse/CASSANDRA-5271
On Tue, Nov 18, 2014 at 12:13 AM, Robert Coli <rc...@eventbrite.com> wrote:
> On Mon, Nov 17, 2014 at 12:04 PM, Alain Vandendorpe <al...@tapstream.com>
> wrote:
>
>> With bootstrapping and initial compactions finished that node now has
>> what seems to be duplicate data, with almost exactly 2x the expected disk
>> usage. CQL returns correct results but we depend on the ability to directly
>> read the SSTable files (hence also RF=1.)
>>
>> Would anyone have suggestions on a good way to resolve this?
>>
>
> (If I understand correctly, the new node is now joined to the cluster; the
> below assumes this.)
>
> ** The simplest, slightly inconvenient, way, which temporarily reduces
> capacity :
>
> 1) nodetool cleanup # on the original node
>
> This removes obsolete data from the original node, which has moved to the
> new node. I mention this in case you did not already do it as part of
> joining the new node. There are some edge cases [1] where you will "wake
> up" old data if you haven't done this before decommission of the new node.
>
> 2) nodetool decommission # on the new node
>
> This moves the data from the new node back onto the old node and removes
> the new node from the cluster.
>
> 3) wipe data from new node # including the system keyspace
>
> 4) re-bootstrap new node
>
> ** The second simplest way, which requires using Size Tiered Compaction
> Strategy (STS) but does not reduce capacity until step 2) :
>
> 1) nodetool compact
>
> This will merge all your duplicates into One Big SSTable.
>
> 2) if necessary, once RF>1, use sstablesplit [1] (with the node down) to
> split up your One Big SSTable.
>
> If you're not using STS, you can temporarily switch to it, but 2) becomes
> less straightforward.
>
> =Rob
> http://twitter.com/rcolidba
> [1] https://issues.apache.org/jira/browse/CASSANDRA-7764
> [2]
> http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsSSTableSplit.html
>
>
Re: Deduplicating data on a node (RF=1)
Posted by Robert Coli <rc...@eventbrite.com>.
On Mon, Nov 17, 2014 at 12:04 PM, Alain Vandendorpe <al...@tapstream.com>
wrote:
> With bootstrapping and initial compactions finished that node now has what
> seems to be duplicate data, with almost exactly 2x the expected disk usage.
> CQL returns correct results but we depend on the ability to directly read
> the SSTable files (hence also RF=1.)
>
> Would anyone have suggestions on a good way to resolve this?
>
(If I understand correctly, the new node is now joined to the cluster; the
below assumes this.)
** The simplest, slightly inconvenient, way, which temporarily reduces
capacity :
1) nodetool cleanup # on the original node
This removes obsolete data from the original node, which has moved to the
new node. I mention this in case you did not already do it as part of
joining the new node. There are some edge cases [1] where you will "wake
up" old data if you haven't done this before decommission of the new node.
2) nodetool decommission # on the new node
This moves the data from the new node back onto the old node and removes
the new node from the cluster.
3) wipe data from new node # including the system keyspace
4) re-bootstrap new node
** The second simplest way, which requires using Size Tiered Compaction
Strategy (STS) but does not reduce capacity until step 2) :
1) nodetool compact
This will merge all your duplicates into One Big SSTable.
2) if necessary, once RF>1, use sstablesplit [1] (with the node down) to
split up your One Big SSTable.
If you're not using STS, you can temporarily switch to it, but 2) becomes
less straightforward.
=Rob
http://twitter.com/rcolidba
[1] https://issues.apache.org/jira/browse/CASSANDRA-7764
[2]
http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsSSTableSplit.html
Re: Deduplicating data on a node (RF=1)
Posted by Eric Stevens <mi...@gmail.com>.
If the new node never formally joined the cluster (streaming never
completed, it never entered UN state), shouldn't that node be safe to scrub
and start over again? It shouldn't be taking primary writes while it's
bootstrapping, should it?
On Mon Nov 17 2014 at 6:34:04 PM Michael Shuler <mi...@pbandjelly.org>
wrote:
> On 11/17/2014 07:20 PM, Jonathan Haddad wrote:
> > If he deletes all the data with RF=1, won't he have data loss?
>
> Of course, ignore my quick answer, Alain.
>
> --
> Michael
>
>
Re: Deduplicating data on a node (RF=1)
Posted by Michael Shuler <mi...@pbandjelly.org>.
On 11/17/2014 07:20 PM, Jonathan Haddad wrote:
> If he deletes all the data with RF=1, won't he have data loss?
Of course, ignore my quick answer, Alain.
--
Michael
Re: Deduplicating data on a node (RF=1)
Posted by Jonathan Haddad <jo...@jonhaddad.com>.
If he deletes all the data with RF=1, won't he have data loss?
On Mon Nov 17 2014 at 5:14:23 PM Michael Shuler <mi...@pbandjelly.org>
wrote:
> On 11/17/2014 02:04 PM, Alain Vandendorpe wrote:
> > Hey all,
> >
> > For legacy reasons we're living with Cassandra 2.0.10 in an RF=1 setup.
> > This is being moved away from ASAP. In the meantime, adding a node
> > recently encountered a Stream Failed error (http://pastie.org/9725846).
> > Cassandra restarted and it seemingly restarted streaming from zero,
> > without having removed the failed stream's data.
> >
> > With bootstrapping and initial compactions finished that node now has
> > what seems to be duplicate data, with almost exactly 2x the expected
> > disk usage. CQL returns correct results but we depend on the ability to
> > directly read the SSTable files (hence also RF=1.)
> >
> > Would anyone have suggestions on a good way to resolve this?
>
> Start over fresh, deleting *all* the data, and bootstrap the node again?
>
> --
> Michael
>
>
Re: Deduplicating data on a node (RF=1)
Posted by Michael Shuler <mi...@pbandjelly.org>.
On 11/17/2014 02:04 PM, Alain Vandendorpe wrote:
> Hey all,
>
> For legacy reasons we're living with Cassandra 2.0.10 in an RF=1 setup.
> This is being moved away from ASAP. In the meantime, adding a node
> recently encountered a Stream Failed error (http://pastie.org/9725846).
> Cassandra restarted and it seemingly restarted streaming from zero,
> without having removed the failed stream's data.
>
> With bootstrapping and initial compactions finished that node now has
> what seems to be duplicate data, with almost exactly 2x the expected
> disk usage. CQL returns correct results but we depend on the ability to
> directly read the SSTable files (hence also RF=1.)
>
> Would anyone have suggestions on a good way to resolve this?
Start over fresh, deleting *all* the data, and bootstrap the node again?
--
Michael