VictoriaMetrics / helm-charts

Helm charts for VictoriaMetrics, VictoriaLogs and ecosystem
https://victoriametrics.github.io/helm-charts/
Apache License 2.0
320 stars 316 forks source link

Failing the existingClaim for multiple replica of VMStorage #1082

Closed hanumanhuda closed 1 month ago

hanumanhuda commented 2 months ago

Values for vmstorage

vmstorage:
  replicaCount: 2
  persistentVolume:
    enabled: true
    accessModes: ReadWriteMany
    existingClaim: test-pvc
    mountPath: /storage
    size: 500Gi

We can provide a single pvc for the vmstorage and all the pods are trying to use the same volume, therefore failing with below errors, however we can't provide multiple PVC for the same. Also can't we use the same volume for all the pods and have different subdirectory at pod level.

Error

"msg":"opening storage at \"/storage\" with -retentionPeriod=1"}
{"ts":"2024-06-26T08:38:04.642Z","level":"panic","caller":"VictoriaMetrics/lib/fs/fs.go:345","msg":"FATAL: cannot create lock file: cannot acquire lock on file \"/storage/flock.lock\": resource temporarily unavailable; make sure a single process has exclusive access to \"/storage\""}
Haleygo commented 1 month ago

Hello! The error is exposed by vmstorage itself, as vmstorage tries to create a flock.lock file under "/vm-data" to make sure it's the only process has exclusive access to "/vm-data". It's needed to avoid data conflicted. Could you elaborate your use case here? Why do you want all the vmstorage nodes to use the same PVC?

hanumanhuda commented 1 month ago

thanks @Haleygo for responding, I was able to resolve the issue by using PVC templating for multiple replica of storage instead of using pre-created pvc.