question

igor.rmarinho_185445 avatar image
igor.rmarinho_185445 asked Erick Ramirez answered

Does nodetool snapshot also flush memtables to disk?

Hi,

I have a few questions about the snapshot. Usually I do

nodetool clearsnapshot --all
nodetool flush
nodetool upgradesstables
nodetool snapshot -t snapshot_name

But the snapshot command already flushs all tables, right?

What would be the best practice for it?

2 - On Datastax site I found

sf, --skip_flush
Do not flush tables before creating the snapshot.CAUTION: Snapshot will not contain unflushed data.

Why it's saying to not flush the tables before taking a snapshot if the snapshot command do it?

cassandrabackup
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

@igor.rmarinho_185445 That's correct. When you take a snapshot, the memtables are flushed to disk first to make sure that all the data is persisted to SSTables before the snapshot is taken.

Why it's saying to not flush the tables before taking a snapshot if the snapshot command do it?

It's just semantics. It is not instructing you to "not flush". It is merely stating that when you specify the skip flag, memtables will not get flushed to disk.

Another point on how you usually do a snapshot -- it is not recommended nor is it required to run nodetool upgradesstables before taking a snapshot. That command is only necessary when you have performed a binary upgrade. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.