Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Fix client mount generation (#2450)
Browse files Browse the repository at this point in the history
Latest version of EXAScaler appears to have a number of new resource
constraints that weren't in the previous version.

This in turn has exposed a bug where we are not filtering by banned resource properly
and are picking up all target bans, not just the MGS one.

Instead, we should match the resource mount_point with the target
mount_path to only include the relevant resource.

Signed-off-by: Joe Grund <jgrund@whamcloud.io>
  • Loading branch information
jgrund authored Dec 22, 2020
1 parent dd7769b commit f8b78b5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
10 changes: 6 additions & 4 deletions iml-api/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,14 +1516,16 @@ async fn client_mount_source(pg_pool: &PgPool, fs_name: &str) -> Result<String,
SELECT n.nid FROM target AS t
INNER JOIN lnet as l ON l.host_id = ANY(t.host_ids)
INNER JOIN nid as n ON n.id = ANY(l.nids)
WHERE t.name='MGS' AND $1 = ANY(t.filesystems) AND n.host_id NOT IN (
WHERE t.name='MGS' AND $1 = ANY(t.filesystems)
AND n.host_id NOT IN (
SELECT nh.host_id
FROM corosync_resource_bans b
INNER JOIN corosync_node_managed_host nh ON (nh.corosync_node_id).name = b.node
AND nh.cluster_id = b.cluster_id
INNER JOIN corosync_resource t ON t.name = b.resource AND b.cluster_id = t.cluster_id
WHERE t.mount_point is not NULL
) GROUP BY l.host_id, n.nid ORDER BY l.host_id, n.nid;
INNER JOIN corosync_resource r ON r.name = b.resource AND b.cluster_id = r.cluster_id
WHERE r.mount_point is not NULL AND r.mount_point = t.mount_path
)
GROUP BY l.host_id, n.nid ORDER BY l.host_id, n.nid
"#,
fs_name
)
Expand Down
40 changes: 20 additions & 20 deletions sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4496,6 +4496,26 @@
"nullable": []
}
},
"ceff1ca4a42d0a41561eb3c3f51f5e720138c890d76437845b74889fc82410cb": {
"query": "\n SELECT n.nid FROM target AS t\n INNER JOIN lnet as l ON l.host_id = ANY(t.host_ids)\n INNER JOIN nid as n ON n.id = ANY(l.nids)\n WHERE t.name='MGS' AND $1 = ANY(t.filesystems)\n AND n.host_id NOT IN (\n SELECT nh.host_id\n FROM corosync_resource_bans b\n INNER JOIN corosync_node_managed_host nh ON (nh.corosync_node_id).name = b.node\n AND nh.cluster_id = b.cluster_id\n INNER JOIN corosync_resource r ON r.name = b.resource AND b.cluster_id = r.cluster_id\n WHERE r.mount_point is not NULL AND r.mount_point = t.mount_path\n )\n GROUP BY l.host_id, n.nid ORDER BY l.host_id, n.nid\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "nid",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
}
},
"d21d5385bab3f2131870f7eb192ae2e6a6e44ea485f571a20861dd0cedb2070b": {
"query": "select id from django_content_type where model = 'lustreclientmount'",
"describe": {
Expand Down Expand Up @@ -5098,26 +5118,6 @@
"nullable": []
}
},
"e99781622236f4fd9b7c6cbb2ee291e026cd430a1a5bed35e0ede9aa384fd626": {
"query": "\n SELECT n.nid FROM target AS t\n INNER JOIN lnet as l ON l.host_id = ANY(t.host_ids)\n INNER JOIN nid as n ON n.id = ANY(l.nids)\n WHERE t.name='MGS' AND $1 = ANY(t.filesystems) AND n.host_id NOT IN (\n SELECT nh.host_id\n FROM corosync_resource_bans b\n INNER JOIN corosync_node_managed_host nh ON (nh.corosync_node_id).name = b.node\n AND nh.cluster_id = b.cluster_id\n INNER JOIN corosync_resource t ON t.name = b.resource AND b.cluster_id = t.cluster_id\n WHERE t.mount_point is not NULL\n ) GROUP BY l.host_id, n.nid ORDER BY l.host_id, n.nid;\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "nid",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
}
},
"ec70b9a5caeadc31f5d1359737cc1c6da64e41db8315a81d81420d3b37b182c5": {
"query": "\n UPDATE chroma_core_task\n SET running_on_id = $1\n WHERE id = $2\n AND running_on_id is Null",
"describe": {
Expand Down

0 comments on commit f8b78b5

Please sign in to comment.