Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F640631F for ; Tue, 7 Jun 2011 05:26:21 +0000 (UTC) Received: (qmail 18254 invoked by uid 500); 7 Jun 2011 05:26:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 18165 invoked by uid 500); 7 Jun 2011 05:26:18 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 18157 invoked by uid 99); 7 Jun 2011 05:26:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 05:26:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ben.coverston@datastax.com designates 209.85.161.172 as permitted sender) Received: from [209.85.161.172] (HELO mail-gx0-f172.google.com) (209.85.161.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 05:26:11 +0000 Received: by gxk19 with SMTP id 19so2386145gxk.31 for ; Mon, 06 Jun 2011 22:25:50 -0700 (PDT) Received: by 10.90.210.12 with SMTP id i12mr5114472agg.47.1307424350384; Mon, 06 Jun 2011 22:25:50 -0700 (PDT) Received: from Ben-Coverstons-MacBook-Pro.local (c-67-166-71-138.hsd1.ut.comcast.net [67.166.71.138]) by mx.google.com with ESMTPS id t27sm3820244anh.1.2011.06.06.22.25.49 (version=SSLv3 cipher=OTHER); Mon, 06 Jun 2011 22:25:49 -0700 (PDT) Message-ID: <4DEDB65C.203@datastax.com> Date: Mon, 06 Jun 2011 23:25:48 -0600 From: Benjamin Coverston User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: Backups, Snapshots, SSTable Data Files, Compaction References: <4DEDB132.4070100@dude.podzone.net> In-Reply-To: <4DEDB132.4070100@dude.podzone.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi AJ, inline: On 6/6/11 11:03 PM, AJ wrote: > Hi, > > I am working on a backup strategy and am trying to understand what is > going on in the data directory. > > I notice that after a write to a CF and then flush, a new set of data > files are created with an index number incremented in their names, > such as: > > Initially: > Users-e-1-Filter.db > Users-e-1-Index.db > Users-e-1-Statistics.db > > Then, after a write to the Users CF, followed by a flush: > Users-e-2-Filter.db > Users-e-2-Index.db > Users-e-2-Statistics.db > > Currently, my data dir has about 16 sets. I thought that compaction > (with nodetool) would clean-up these files, but it doesn't. Neither > does cleanup or repair. You're not even talking about snapshots using nodetool snapshot yet. Also nodetool compact does compact all of the live files, however the compacted SSTables will not be cleaned up until a garbage collection is triggered, or a capacity threshold is met. > Q1: Should the files with the lower index #'s (under the > data/{keyspace} directory) be manually deleted? Or, do ALL of the > files in this directory need to be backed-up? Do not ever delete files in your data directory if you care about data on that replica, unless they are from a column family that no longer exists on that server. There may be some duplicate data in the files, but if the files are in the data directory, as a general rule, they are there because they contain some set of data that is in none of the other SSTables. > Q2: Can someone elaborate on the structure of these files and if they > are interrelated? I'm guessing that maybe each incremental set is > like an incremental or differential backup of the SSTable, but I'm not > sure. The reason I ask is because I hope that each set isn't a full > copy of the data, eg, if my data set size for a given CF is 1 TB, I > will not end up with 16 TB worth of data files after 16 calls to > flush... I suspect not, but I'm just double-checking ;o) > The are interrelated only in the sense that they contain data associated with the same column family. Each set may contain a complete, partial, or entirely independent set of the data depending on your write pattern and the frequency of minor compactions. > Q3: When and how are these extra files removed or reduced? A GC or a threshold. > > Thanks! -- Ben Coverston Director of Operations DataStax -- The Apache Cassandra Company http://www.datastax.com/