You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ben Chobot <be...@instructure.com> on 2014/10/15 17:12:35 UTC

How to restore a snapshot in cassandra 1.1

I was going over http://www.datastax.com/docs/1.1/backup_restore, which seems pretty clear about how to restore a snapshot. Basically, it seems the procedure is to stop your node, wipe the commit logs, move the snapshotted sstables into place, and restart. That makes sense…. so long as you only have one keyspace. But what happens when you have multiple keyspaces and you only want to restore one of them? Is that supported? It seems that wiping the commit logs has the potential for unexpected data loss on the keyspaces you didn’t want to restore.

Re: How to restore a snapshot in cassandra 1.1

Posted by Robert Coli <rc...@eventbrite.com>.
On Thu, Oct 16, 2014 at 3:57 PM, Ben Chobot <be...@instructure.com> wrote:

> We're wiping the commit logs because that's what the datastax instructions
> say to do. (Also the old Cassandra Ops wiki.) I assume it's so that changes
> that no longer apply to the node aren't replayed when it's restarted with
> old sstables.
>
> Of course, my question is about when you have multiple keyspaces.
> Presumably some changelogs might still apply and some might not, but AFAICT
> there's no way to separate them out.
>
> It might just be that this kind of snapshot restore (one but not all
> keyspaces) just isn't supported in Cassandra 1.1?
>

I told you what to do already, sorry if it was unclear :

" just nodetool drain (although this doesn't actually reliably work in 1.1
era... [1]) before stopping the node. "

Honestly not sure why the Datastax instructions tell you to delete the
commitlog instead of using nodetool drain. I've added them (docs@ ...) to a
bcc: here for their information.

=Rob
http://twitter.com/rcolidba

Re: How to restore a snapshot in cassandra 1.1

Posted by Ben Chobot <be...@instructure.com>.
We're wiping the commit logs because that's what the datastax instructions say to do. (Also the old Cassandra Ops wiki.) I assume it's so that changes that no longer apply to the node aren't replayed when it's restarted with old sstables.

Of course, my question is about when you have multiple keyspaces. Presumably some changelogs might still apply and some might not, but AFAICT there's no way to separate them out.

It might just be that this kind of snapshot restore (one but not all keyspaces) just isn't supported in Cassandra 1.1?

On Oct 15, 2014, at 11:58 AM, Robert Coli <rc...@eventbrite.com> wrote:

> On Wed, Oct 15, 2014 at 8:12 AM, Ben Chobot <be...@instructure.com> wrote:
> I was going over http://www.datastax.com/docs/1.1/backup_restore, which seems pretty clear about how to restore a snapshot. Basically, it seems the procedure is to stop your node, wipe the commit logs, move the snapshotted sstables into place, and restart. That makes sense…. so long as you only have one keyspace. But what happens when you have multiple keyspaces and you only want to restore one of them? Is that supported? It seems that wiping the commit logs has the potential for unexpected data loss on the keyspaces you didn’t want to restore.
> 
> For what purpose are you wiping the commit logs as they relate to the keyspaces being restored? Are you trying to avoid in-flight writes?
> 
> If so, just nodetool drain (although this doesn't actually reliably work in 1.1 era... [1]) before stopping the node.
> 
> =Rob
> http://twitter.com/rcolidba
> [1] https://issues.apache.org/jira/browse/CASSANDRA-4446


Re: How to restore a snapshot in cassandra 1.1

Posted by Robert Coli <rc...@eventbrite.com>.
On Wed, Oct 15, 2014 at 8:12 AM, Ben Chobot <be...@instructure.com> wrote:

> I was going over http://www.datastax.com/docs/1.1/backup_restore, which
> seems pretty clear about how to restore a snapshot. Basically, it seems the
> procedure is to stop your node, wipe the commit logs, move the snapshotted
> sstables into place, and restart. That makes sense…. so long as you only
> have one keyspace. But what happens when you have multiple keyspaces and
> you only want to restore one of them? Is that supported? It seems that
> wiping the commit logs has the potential for unexpected data loss on the
> keyspaces you didn’t want to restore.
>

For what purpose are you wiping the commit logs as they relate to the
keyspaces being restored? Are you trying to avoid in-flight writes?

If so, just nodetool drain (although this doesn't actually reliably work in
1.1 era... [1]) before stopping the node.

=Rob
http://twitter.com/rcolidba
[1] https://issues.apache.org/jira/browse/CASSANDRA-4446