You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sameer Farooqui <ca...@gmail.com> on 2011/07/14 01:18:41 UTC

Question about compaction

Running Cassandra 0.8.1. Ran major compaction via:

sudo /home/ubuntu/brisk/resources/cassandra/bin/nodetool -h localhost
compact &

>From what I'd read about Cassandra, I thought that after compaction all of
the different SSTables on disk for a Column Family would be merged into one
new file.

However, there are now a bunch of 0-sized Compacted files and a bunch of
Data files. Any ideas about why there are still so many files left?

Also, is a minor compaction the same thing as a read-only compaction in 0.7?


ubuntu@domU-12-31-39-0E-x-x:/raiddrive/data/DemoKS$ ls -l
total 270527136
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5670-Compacted
-rw-r--r-- 1 root root  89457447799 2011-07-10 00:26 DemoCF-g-5670-Data.db
-rw-r--r-- 1 root root       193456 2011-07-10 00:26 DemoCF-g-5670-Filter.db
-rw-r--r-- 1 root root      2081159 2011-07-10 00:26 DemoCF-g-5670-Index.db
-rw-r--r-- 1 root root         4276 2011-07-10 00:26
DemoCF-g-5670-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5686-Compacted
-rw-r--r-- 1 root root    920521489 2011-07-09 22:03 DemoCF-g-5686-Data.db
-rw-r--r-- 1 root root        11776 2011-07-09 22:03 DemoCF-g-5686-Filter.db
-rw-r--r-- 1 root root       126725 2011-07-09 22:03 DemoCF-g-5686-Index.db
-rw-r--r-- 1 root root         4276 2011-07-09 22:03
DemoCF-g-5686-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5781-Compacted
-rw-r--r-- 1 root root    223970446 2011-07-09 22:38 DemoCF-g-5781-Data.db
-rw-r--r-- 1 root root         7216 2011-07-09 22:38 DemoCF-g-5781-Filter.db
-rw-r--r-- 1 root root        32750 2011-07-09 22:38 DemoCF-g-5781-Index.db
-rw-r--r-- 1 root root         4276 2011-07-09 22:38
DemoCF-g-5781-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5874-Compacted
-rw-r--r-- 1 root root    156284248 2011-07-09 23:20 DemoCF-g-5874-Data.db
-rw-r--r-- 1 root root         5056 2011-07-09 23:20 DemoCF-g-5874-Filter.db
-rw-r--r-- 1 root root        10400 2011-07-09 23:20 DemoCF-g-5874-Index.db
-rw-r--r-- 1 root root         4276 2011-07-09 23:20
DemoCF-g-5874-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-6938-Compacted
-rw-r--r-- 1 root root  22947541446 2011-07-10 11:43 DemoCF-g-6938-Data.db
-rw-r--r-- 1 root root        49936 2011-07-10 11:43 DemoCF-g-6938-Filter.db
-rw-r--r-- 1 root root       563550 2011-07-10 11:43 DemoCF-g-6938-Index.db
-rw-r--r-- 1 root root         4276 2011-07-10 11:43
DemoCF-g-6938-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-6996-Compacted
-rw-r--r-- 1 root root    224253930 2011-07-10 11:28 DemoCF-g-6996-Data.db
-rw-r--r-- 1 root root         7216 2011-07-10 11:27 DemoCF-g-6996-Filter.db
-rw-r--r-- 1 root root        26250 2011-07-10 11:28 DemoCF-g-6996-Index.db
-rw-r--r-- 1 root root         4276 2011-07-10 11:28
DemoCF-g-6996-Statistics.db
-rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-8324-Compacted

Re: Question about compaction

Posted by Sameer Farooqui <ca...@gmail.com>.
You were right, Maki. Restarting Cassandra cleaned up the directory and now
there are only two SSTable files.


On Thu, Jul 14, 2011 at 9:08 AM, Maki Watanabe <wa...@gmail.com>wrote:

> These 0 byte files with "-Compacted" suffix indicate that the
> associated sstables can be removed.
> In current version, Cassandra delete compacted sstables at Full GC and
> on startup.
>
> maki
>
>
> 2011/7/14 Sameer Farooqui <ca...@gmail.com>:
> > Running Cassandra 0.8.1. Ran major compaction via:
> >
> > sudo /home/ubuntu/brisk/resources/cassandra/bin/nodetool -h localhost
> > compact &
> >
> > From what I'd read about Cassandra, I thought that after compaction all
> of
> > the different SSTables on disk for a Column Family would be merged into
> one
> > new file.
> >
> > However, there are now a bunch of 0-sized Compacted files and a bunch of
> > Data files. Any ideas about why there are still so many files left?
> >
> > Also, is a minor compaction the same thing as a read-only compaction in
> 0.7?
> >
> >
> > ubuntu@domU-12-31-39-0E-x-x:/raiddrive/data/DemoKS$ ls -l
> > total 270527136
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-5670-Compacted
> > -rw-r--r-- 1 root root  89457447799 2011-07-10 00:26
> DemoCF-g-5670-Data.db
> > -rw-r--r-- 1 root root       193456 2011-07-10 00:26
> DemoCF-g-5670-Filter.db
> > -rw-r--r-- 1 root root      2081159 2011-07-10 00:26
> DemoCF-g-5670-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-10 00:26
> > DemoCF-g-5670-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-5686-Compacted
> > -rw-r--r-- 1 root root    920521489 2011-07-09 22:03
> DemoCF-g-5686-Data.db
> > -rw-r--r-- 1 root root        11776 2011-07-09 22:03
> DemoCF-g-5686-Filter.db
> > -rw-r--r-- 1 root root       126725 2011-07-09 22:03
> DemoCF-g-5686-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-09 22:03
> > DemoCF-g-5686-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-5781-Compacted
> > -rw-r--r-- 1 root root    223970446 2011-07-09 22:38
> DemoCF-g-5781-Data.db
> > -rw-r--r-- 1 root root         7216 2011-07-09 22:38
> DemoCF-g-5781-Filter.db
> > -rw-r--r-- 1 root root        32750 2011-07-09 22:38
> DemoCF-g-5781-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-09 22:38
> > DemoCF-g-5781-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-5874-Compacted
> > -rw-r--r-- 1 root root    156284248 2011-07-09 23:20
> DemoCF-g-5874-Data.db
> > -rw-r--r-- 1 root root         5056 2011-07-09 23:20
> DemoCF-g-5874-Filter.db
> > -rw-r--r-- 1 root root        10400 2011-07-09 23:20
> DemoCF-g-5874-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-09 23:20
> > DemoCF-g-5874-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-6938-Compacted
> > -rw-r--r-- 1 root root  22947541446 2011-07-10 11:43
> DemoCF-g-6938-Data.db
> > -rw-r--r-- 1 root root        49936 2011-07-10 11:43
> DemoCF-g-6938-Filter.db
> > -rw-r--r-- 1 root root       563550 2011-07-10 11:43
> DemoCF-g-6938-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-10 11:43
> > DemoCF-g-6938-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-6996-Compacted
> > -rw-r--r-- 1 root root    224253930 2011-07-10 11:28
> DemoCF-g-6996-Data.db
> > -rw-r--r-- 1 root root         7216 2011-07-10 11:27
> DemoCF-g-6996-Filter.db
> > -rw-r--r-- 1 root root        26250 2011-07-10 11:28
> DemoCF-g-6996-Index.db
> > -rw-r--r-- 1 root root         4276 2011-07-10 11:28
> > DemoCF-g-6996-Statistics.db
> > -rw-r--r-- 1 root root            0 2011-07-13 03:07
> DemoCF-g-8324-Compacted
> >
> >
>
>
>
> --
> w3m
>

Re: Question about compaction

Posted by Maki Watanabe <wa...@gmail.com>.
These 0 byte files with "-Compacted" suffix indicate that the
associated sstables can be removed.
In current version, Cassandra delete compacted sstables at Full GC and
on startup.

maki


2011/7/14 Sameer Farooqui <ca...@gmail.com>:
> Running Cassandra 0.8.1. Ran major compaction via:
>
> sudo /home/ubuntu/brisk/resources/cassandra/bin/nodetool -h localhost
> compact &
>
> From what I'd read about Cassandra, I thought that after compaction all of
> the different SSTables on disk for a Column Family would be merged into one
> new file.
>
> However, there are now a bunch of 0-sized Compacted files and a bunch of
> Data files. Any ideas about why there are still so many files left?
>
> Also, is a minor compaction the same thing as a read-only compaction in 0.7?
>
>
> ubuntu@domU-12-31-39-0E-x-x:/raiddrive/data/DemoKS$ ls -l
> total 270527136
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5670-Compacted
> -rw-r--r-- 1 root root  89457447799 2011-07-10 00:26 DemoCF-g-5670-Data.db
> -rw-r--r-- 1 root root       193456 2011-07-10 00:26 DemoCF-g-5670-Filter.db
> -rw-r--r-- 1 root root      2081159 2011-07-10 00:26 DemoCF-g-5670-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-10 00:26
> DemoCF-g-5670-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5686-Compacted
> -rw-r--r-- 1 root root    920521489 2011-07-09 22:03 DemoCF-g-5686-Data.db
> -rw-r--r-- 1 root root        11776 2011-07-09 22:03 DemoCF-g-5686-Filter.db
> -rw-r--r-- 1 root root       126725 2011-07-09 22:03 DemoCF-g-5686-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-09 22:03
> DemoCF-g-5686-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5781-Compacted
> -rw-r--r-- 1 root root    223970446 2011-07-09 22:38 DemoCF-g-5781-Data.db
> -rw-r--r-- 1 root root         7216 2011-07-09 22:38 DemoCF-g-5781-Filter.db
> -rw-r--r-- 1 root root        32750 2011-07-09 22:38 DemoCF-g-5781-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-09 22:38
> DemoCF-g-5781-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-5874-Compacted
> -rw-r--r-- 1 root root    156284248 2011-07-09 23:20 DemoCF-g-5874-Data.db
> -rw-r--r-- 1 root root         5056 2011-07-09 23:20 DemoCF-g-5874-Filter.db
> -rw-r--r-- 1 root root        10400 2011-07-09 23:20 DemoCF-g-5874-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-09 23:20
> DemoCF-g-5874-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-6938-Compacted
> -rw-r--r-- 1 root root  22947541446 2011-07-10 11:43 DemoCF-g-6938-Data.db
> -rw-r--r-- 1 root root        49936 2011-07-10 11:43 DemoCF-g-6938-Filter.db
> -rw-r--r-- 1 root root       563550 2011-07-10 11:43 DemoCF-g-6938-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-10 11:43
> DemoCF-g-6938-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-6996-Compacted
> -rw-r--r-- 1 root root    224253930 2011-07-10 11:28 DemoCF-g-6996-Data.db
> -rw-r--r-- 1 root root         7216 2011-07-10 11:27 DemoCF-g-6996-Filter.db
> -rw-r--r-- 1 root root        26250 2011-07-10 11:28 DemoCF-g-6996-Index.db
> -rw-r--r-- 1 root root         4276 2011-07-10 11:28
> DemoCF-g-6996-Statistics.db
> -rw-r--r-- 1 root root            0 2011-07-13 03:07 DemoCF-g-8324-Compacted
>
>



-- 
w3m