This is a problem that has existed in all versions I've tried (1.7.x, 1.8.x and 2.0beta) so isn't urgent, but would be nice to fix.
The issue is that the disk space stats are reported incorrectly, in the case where the data location is not mounted on root, or is a symlink
eg, in our configuration, our data directory is:
which is mounted as:
/export/fds/Linux_RHEL5_x86_64/couchbase on /home/fds/couchbase type none (rw,bind)
(output from running the "mount" command at the commandline)
The issue is that this location is actually mounted under "/export", but couchbase incorrectly assumes that it is mounted under "/", since it uses simple prefix matching to try to work out which device a path is mounted on.
This results in incorrect figures being reported for diskspace remaining (a large negative number in our case, since the root partition is smaller than /export)
A more correct way to determine the device for a given path is to compare the device number, as reported by stat.
I've written some Erlang which I believe is a drop-in replacement for the function extract_disk_stats_for_path in ns_server/src/ns_storage_conf.erl and which corrects this bug.
Erlang is not a language I'm very familiar with, so this probably needs checking and tidying up, but hopefully it proves the concept:
DeviceName = element(1, DeviceInfo),
device_num_for_path(DeviceName) == TargetDeviceNum.
extract_disk_stats_for_path(StatsList, Path0) ->
TargetDeviceNum = device_num_for_path(Path0),
[Result] = lists:filter(fun(X) -> is_target_device(TargetDeviceNum, X) end,
DiskInfo = extract_disk_stats_for_path(disksup:get_disk_data(), Path),
io:fwrite("Diskspace for ~s: ~w~n~n", [Path, element(2,DiskInfo)]).