Skip to content

Commit 91e4475

Browse files
authored
Merge pull request #179 from arangodb/bugfix/prefer-distinc-nodes
Prefer distinct nodes, even when not required
2 parents d9db5e9 + 80b7f81 commit 91e4475

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/storage/pv_creator.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (ls *LocalStorage) createPVs(ctx context.Context, apiObject *api.ArangoLoca
8181
// Find deployment name & role in the claim (if any)
8282
deplName, role, enforceAniAffinity := getDeploymentInfo(claim)
8383
allowedClients := clients
84-
if enforceAniAffinity && deplName != "" {
84+
if deplName != "" {
8585
// Select nodes to choose from such that no volume in group lands on the same node
8686
if nodeClientMap == nil {
8787
nodeClientMap = createNodeClientMap(ctx, clients)
@@ -92,6 +92,11 @@ func (ls *LocalStorage) createPVs(ctx context.Context, apiObject *api.ArangoLoca
9292
log.Warn().Err(err).Msg("Failed to filter allowed nodes")
9393
continue // We'll try this claim again later
9494
}
95+
if !enforceAniAffinity && len(allowedClients) == 0 {
96+
// No possible nodes found that have no other volume (in same group) on it.
97+
// We don't have to enforce separate nodes, so use all clients.
98+
allowedClients = clients
99+
}
95100
}
96101

97102
// Find size of PVC

0 commit comments

Comments
 (0)