16347: Run a dedicated keepstore process for each container.
[arvados.git] / lib / config / load.go
index 248960beb99f875620dca5ee7738f8575877c57d..b6375c820fa110a1b85fe009261a3cae6e5127c9 100644 (file)
@@ -297,6 +297,7 @@ func (ldr *Loader) Load() (*arvados.Config, error) {
                        checkKeyConflict(fmt.Sprintf("Clusters.%s.PostgreSQL.Connection", id), cc.PostgreSQL.Connection),
                        ldr.checkEmptyKeepstores(cc),
                        ldr.checkUnlistedKeepstores(cc),
+                       ldr.checkLocalKeepstoreVolumes(cc),
                        ldr.checkStorageClasses(cc),
                        // TODO: check non-empty Rendezvous on
                        // services other than Keepstore
@@ -361,6 +362,18 @@ cluster:
        return nil
 }
 
+func (ldr *Loader) checkLocalKeepstoreVolumes(cc arvados.Cluster) error {
+       if cc.Containers.LocalKeepBlobBuffersPerVCPU < 1 {
+               return nil
+       }
+       for _, vol := range cc.Volumes {
+               if len(vol.AccessViaHosts) == 0 {
+                       return nil
+               }
+       }
+       return fmt.Errorf("LocalKeepBlobBuffersPerVCPU is %d, but no volumes would be accessible from a worker instance", cc.Containers.LocalKeepBlobBuffersPerVCPU)
+}
+
 func (ldr *Loader) checkStorageClasses(cc arvados.Cluster) error {
        classOnVolume := map[string]bool{}
        for volid, vol := range cc.Volumes {