Commit bdb6959b authored by Leigh B Stoller's avatar Leigh B Stoller

Bug fix for lannode checks.

Bug fix for alloconly() mode; must set the allocstate (I was treating
it like impotent()), and must also set the vname in the reserved table
entry so that an update (before redeem) works properly.
parent 932b7d30
...@@ -3146,6 +3146,10 @@ sub AddLinkToSolution($$$$$$$$) ...@@ -3146,6 +3146,10 @@ sub AddLinkToSolution($$$$$$$$)
$member0->_lannode($nodeB); $member0->_lannode($nodeB);
$member0->_lanport($portB); $member0->_lanport($portB);
} }
else {
$member0->_lannode("null");
$member0->_lanport("null");
}
} }
} }
elsif (($lan,$virtA) = elsif (($lan,$virtA) =
...@@ -3656,7 +3660,7 @@ sub AllocNodes($) ...@@ -3656,7 +3660,7 @@ sub AllocNodes($)
if (exists($self->solution()->{'TORESERVE'}->{$nodeid})) { if (exists($self->solution()->{'TORESERVE'}->{$nodeid})) {
$self->newreserved()->{$nodeid} = $nodeid; $self->newreserved()->{$nodeid} = $nodeid;
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY()) $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY())
if (!($self->impotent() || $self->alloconly())); if ($self->impotent());
# #
# Fix all of the nodes assigned to the pnode. # Fix all of the nodes assigned to the pnode.
...@@ -3769,7 +3773,7 @@ sub AllocNodes($) ...@@ -3769,7 +3773,7 @@ sub AllocNodes($)
# Mark it for teardown by the caller (tbswap currently). # Mark it for teardown by the caller (tbswap currently).
# #
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN()) $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN())
if (!($self->impotent() || $self->alloconly())); if (! $self->impotent());
} }
elsif ($pnode->_reuse() eq "reboot") { elsif ($pnode->_reuse() eq "reboot") {
# #
...@@ -3777,7 +3781,7 @@ sub AllocNodes($) ...@@ -3777,7 +3781,7 @@ sub AllocNodes($)
# it should be rebooted. # it should be rebooted.
# #
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY()) $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY())
if (!($self->impotent() || $self->alloconly())); if (! $self->impotent());
} }
} }
skip: skip:
...@@ -4134,8 +4138,7 @@ sub AllocVirtNodes($) ...@@ -4134,8 +4138,7 @@ sub AllocVirtNodes($)
"nodeid" => $physical, "nodeid" => $physical,
"debug" => 0, "debug" => 0,
"verbose" => $self->verbose(), "verbose" => $self->verbose(),
"impotent" => $self->impotent() || "impotent" => $self->impotent(),
$self->alloconly(),
"sharedokay" => $sharedokay, "sharedokay" => $sharedokay,
"regression" => $self->regression()}) "regression" => $self->regression()})
< 0) { < 0) {
...@@ -4225,7 +4228,7 @@ sub AllocVirtNodes($) ...@@ -4225,7 +4228,7 @@ sub AllocVirtNodes($)
# state they were in so that os_setup/vnode_setup know they # state they were in so that os_setup/vnode_setup know they
# need to reboot them. # need to reboot them.
# #
if (!($self->impotent() || $self->alloconly())) { if (! $self->impotent()) {
if (!exists($self->current_v2v()->{$virtual})) { if (!exists($self->current_v2v()->{$virtual})) {
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_CLEAN()); $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_CLEAN());
} }
...@@ -4234,6 +4237,12 @@ sub AllocVirtNodes($) ...@@ -4234,6 +4237,12 @@ sub AllocVirtNodes($)
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY()); $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_INIT_DIRTY());
} }
} }
#
# When doing alloconly, we have to set the vname for the
# physical nodes so that update works.
#
$pnode->ModifyReservation({"vname" => $virtual}) == 0
or return -1 if (!$self->impotent() && $self->alloconly());
} }
# Since we have some extra physical vnodes reserved on this pnode, # Since we have some extra physical vnodes reserved on this pnode,
...@@ -4246,7 +4255,9 @@ sub AllocVirtNodes($) ...@@ -4246,7 +4255,9 @@ sub AllocVirtNodes($)
my $pnode = $self->pnodes()->{$pname}; my $pnode = $self->pnodes()->{$pname};
$pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN()) $pnode->SetAllocState(TBDB_ALLOCSTATE_RES_TEARDOWN())
if (!($self->impotent() || $self->alloconly())); if (!$self->impotent() &&
$pnode->allocstate() ne
TBDB_ALLOCSTATE_RES_INIT_CLEAN());
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment