[Pkg-erlang-devel] Bug#611988: couchdb: after successfull compaction CouchDB still access deleted .couch file

Andreas Unterkircher unki at netshadow.at
Fri Feb 4 11:30:17 UTC 2011


Package: couchdb
Version: 0.11.0-2.3
Severity: normal


When I invoke the following command to trigger a database compaction:

curl -H "Content-Type: application/json" -X POST http://localhost:5984/db/_compact

CouchDB will rebuild its database file and clean up old revisions and so on.

This compaction basically runs successful and afterwards the database got shrinked from some gigabytes to about 300MB here. The database file then looks like this:

user at host:$ sudo ls -l /var/lib/couchdb/0.11.0/db.couch
-rw-r--r-- 1 couchdb couchdb 344699040 2011-02-04 12:11 /var/lib/couchdb/0.11.0/db.couch

The problem is, that after a compaction run, CouchDB still has an open file descriptor on the deleted db.couch file (that was previously so large):

user at host:~$ sudo lsof | grep -i couchdb  | grep -i delete
beam.smp   6596     couchdb   14u      REG      254,7 1839379307        133 /var/lib/couchdb/0.11.0/db.couch (deleted)

Obviously the gained free space is then only returned when I stop/start the CouchDB instance to force it closing the open file handle.

Andreas

-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages couchdb depends on:
ii  adduser                 3.112+nmu2       add and remove users and groups
ii  erlang-base [erlang-abi 1:14.a-dfsg-3    Erlang/OTP virtual machine and bas
ii  erlang-crypto           1:14.a-dfsg-3    Erlang/OTP cryptographic modules
ii  erlang-inets            1:14.a-dfsg-3    Erlang/OTP Internet clients and se
ii  erlang-ssl              1:14.a-dfsg-3    Erlang/OTP implementation of SSL
ii  erlang-tools            1:14.a-dfsg-3    Erlang/OTP various tools
ii  erlang-xmerl            1:14.a-dfsg-3    Erlang/OTP XML tools
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libcurl3                7.21.0-1         Multi-protocol file transfer libra
ii  libicu44                4.4.1-7          International Components for Unico
ii  libjs-jquery            1.4.2-2          JavaScript library for dynamic web
ii  libmozjs2d              1.9.1.16-4       The Mozilla SpiderMonkey JavaScrip
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  mawk                    1.3.3-15         a pattern scanning and text proces
ii  procps                  1:3.2.8-9        /proc file system utilities

couchdb recommends no packages.

couchdb suggests no packages.

-- Configuration Files:

-- no debconf information





More information about the Pkg-erlang-devel mailing list