Avoid pathological delete mac for millions of nodes (S. Xu)
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
* [#279] Web sessions use cookies instead of files on disk (M. Johnson)
|
* [#279] Web sessions use cookies instead of files on disk (M. Johnson)
|
||||||
* Strip realm from username (B. Marshall)
|
* Strip realm from username (B. Marshall)
|
||||||
* Mention netdisco-users mail list in docs (C. Goldsmith)
|
* Mention netdisco-users mail list in docs (C. Goldsmith)
|
||||||
|
* Avoid pathological delete mac for millions of nodes (S. Xu)
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
|
|||||||
@@ -116,10 +116,11 @@ sub delete {
|
|||||||
NodeNbt
|
NodeNbt
|
||||||
/) {
|
/) {
|
||||||
$schema->resultset($set)->search({
|
$schema->resultset($set)->search({
|
||||||
'-and' => [
|
|
||||||
'me.mac' => { '-in' => $nodes->as_query },
|
|
||||||
'me.mac' => { '-in' => $schema->resultset($set)->search({
|
'me.mac' => { '-in' => $schema->resultset($set)->search({
|
||||||
|
'-and' => [
|
||||||
-bool => 'nodes.active',
|
-bool => 'nodes.active',
|
||||||
|
'me.mac' => { '-in' => $nodes->as_query }
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
columns => 'mac',
|
columns => 'mac',
|
||||||
@@ -128,7 +129,6 @@ sub delete {
|
|||||||
having => \[ 'count(nodes.mac) = 0' ],
|
having => \[ 'count(nodes.mac) = 0' ],
|
||||||
})->as_query,
|
})->as_query,
|
||||||
},
|
},
|
||||||
],
|
|
||||||
})->delete;
|
})->delete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user