couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

Disk Monitor is not triggered inside the container with single node

Open adajani opened this issue 7 months ago • 2 comments

Description

Configuring the disk monitor feature to let couchdb reacts proactively when disk space gets low is not triggered inside the container with single node .

Steps to Reproduce

  1. Edit default.ini to enable [disk_monitor]

Image

  1. Run the container: sudo docker run -d --name my-couchdb -e COUCHDB_USER=*** -e COUCHDB_PASSWORD=*** -p 5984:5984 -v /mnt/couchdb_mount:/opt/couchdb/data -v ./default.ini:/opt/couchdb/etc/default.ini couchdb
  2. Fill the couchdb volume with dump data using dd tool to exceed the write threshold
  3. Create a databae by sending PUT request curl -i -X PUT http://***:***@localhost:5984/test2

Expected Behaviour

I expect couchdb to return 507 (Insufficient Storage) response status, or 500 (internal error), while the value I've got is 201 created.

Your Environment

  • Docker version: 26.1.3, build 26.1.3-0ubuntu1~22.04.1
  • CouchDB version used: 3.50
  • Browser name and version: curl tool version 7.81.0
  • Operating system and version: Ubuntu 22.04.2 LTS

Additional Context

The disk status before the request:

Image

Verify the disk image is enabled

Image

Send the request

Image

adajani avatar May 25 '25 19:05 adajani

Hi,

I can't reproduce this locally (no docker). I get a 507 when the threshold got exceeded. My assumption is, that it has to do with your docker environment. What is your disk usage from within your container?

big-r81 avatar May 26 '25 18:05 big-r81

also bear in mind that the erlang os_mon app needs configuring;

The defaults are: https://www.erlang.org/doc/apps/os_mon/disksup.html

And in couchdb we customise to: https://github.com/apache/couchdb/blob/main/rel/overlay/etc/vm.args#L139-L147

so you need to attempt your write after that check interval has lapsed, whatever it happens to be in your environment.

rnewson avatar May 27 '25 16:05 rnewson