Admin ui shows the capacity of the node wrongly

When I run the crdb in my macOS High Sierra with Docker. The command is:
docker run -d --name=roach1 --hostname=roach1 -p 26257:26257 -p 8080:8080 -v "${PWD}/cockroach-data/roach2:/cockroach/cockroach-data" cockroachdb/cockroach:v2.0.4 start --insecure
Then the ui shows:


However, my mac only has the SSD disk of 256G.

Hi @david.xia,

What do you see when you create the node outside of docker? Trying to determine if this is a CRDB / docker issue or something more general. Also, what version are you using?

Another user had a very similar issue to this before, I’m almost certain it must be the same problem ui: AdminUI shows wrong size for cluster summary capacity used

Essentially, when the docker machine mounts the host (MacOSX) file volume, queries for disk return the correct number of blocks, but returned the wrong block size - in his case, 1MiB instead of 4096 bytes. This caused massive inflation of the disk size numbers.

I’m not sure if the user posted his mitigation for this, but this is likely the same unexpected interaction between docker, MacOSX’s file system, and the statfs system call.

I am using the latest version v2.0.4.

What do you see when you create the node outside of docker?
This issue only occurs when I use Docker to mount a local volume with -v "${PWD}/cockroach-data/roach2:/cockroach/cockroach-data". Otherwise, there is no such problem.

So, you mean this is because of the bug between Docker and MacOSx, not in cockroachdb, right? But I’ve never got such kind of problem when I use other applications like mounting a local volume for mysql, postgres. Everyting is fine. I don’t know why it only happens when i use docker for cockroach db.

David, so you know Docker on osx really runs a Linux VM on your mac and connects to it to run container programs. The problem we are seeing here is that the Linux OS function used by CockroachDB to retrieve the “free space” information returns the wrong information.

I am pretty confident that this problem also exists regardless of which database you use. However, chances are that mysql/postgres do not use the same OS function, or that you don’t happen to “see” them using the wrong results (what part of mysql/postgres is really interested in the amount of free space? is there some web ui embedded into mysql/postgres that shows you this information? I don’t recall.)

So yes probably the problem is not specific to CockroachDB.

This doesn’t mean we shouldn’t try to work around it.

It makes sense. Thank you! ^-^

Hey @david.xia, we created this issue for tracking: https://github.com/cockroachdb/cockroach/issues/28541

1 Like