Disk Monitor is not triggered inside the container with single node
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
- Edit default.ini to enable [disk_monitor]
- 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 - Fill the couchdb volume with dump data using dd tool to exceed the write threshold
- 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:
Verify the disk image is enabled
Send the request
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?
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.