seaweedfs / seaweedfs-csi-driver

SeaweedFS CSI Driver https://github.com/seaweedfs/seaweedfs
Apache License 2.0
218 stars 50 forks source link

Cannot open files in csi mounted volume. #64

Open blmhemu opened 2 years ago

blmhemu commented 2 years ago

Background: Followed the deploy/nomad and got the csi up and running. But when trying to run a postgres docker instance, by using a csi volume, I am getting the following error:

2022-06-12 14:36:10.686 UTC [39] LOG:  could not open file "pg_wal/000000010000000000000001": No such file or directory
2022-06-12 14:36:10.687 UTC [39] FATAL:  could not open file "pg_wal/000000010000000000000001": No such file or directory
child process exited with exit code 1

Here is the nomad volume

id        = "postgres"
name      = "postgres"
type      = "csi"
plugin_id = "seaweedfs"

capacity_min = "20GiB"
capacity_max = "20GiB"

capability {
  access_mode     = "multi-node-multi-writer"
  attachment_mode = "file-system"
}

# Optional: for 'nomad volume create', specify mount options to validate for
# 'attachment_mode = "file-system". Registering an existing volume will record
# but ignore these fields.
mount_options {
  mount_flags = ["rw"]
}

parameters {
  # Available options: https://github.com/seaweedfs/seaweedfs-csi-driver/blob/master/pkg/driver/mounter_seaweedfs.go
  collection = "postgres"
  replication = "000"
  path = "/buckets/postgres"
}

In the filer, I could see the folder pg_wal (and disappears later as postgres fails to initialize and cleans-up the data)

As a side note, I tested the volume with other docker container and was able to create and read files. So something specific to postgres or databases in general ?

blmhemu commented 2 years ago

Feels it might have to do something with fsync Ref: https://github.com/Parallels/docker-machine-parallels/issues/71