You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably related to #6904. I found a relevant-looking sled agent log snippet (from oxide-sled-agent:default.log.1729284364); this is the point where the system crossed over from successfully servicing VMM requests to failing to do so:
20:38:35.072Z INFO SledAgent (dropshot (SledAgent)): request completed
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:950
latency_us = 365
local_addr = [fd00:1122:3344:104::1]:12345
method = GET
remote_addr = [fd00:1122:3344:10e::3]:61554
req_id = 27622099-2c46-440c-b189-386adcebecea
response_code = 200
uri = /vmms/3bfe0e53-b1e9-4473-8a92-298984d08e17/state
20:38:35.072Z INFO SledAgent (dropshot (SledAgent)): request completed
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:950
latency_us = 375
local_addr = [fd00:1122:3344:104::1]:12345
method = GET
remote_addr = [fd00:1122:3344:10e::3]:64130
req_id = 616faeea-d021-4145-9ba0-b004bfaf66be
response_code = 200
uri = /vmms/08704209-ff3e-4d96-a6e9-901b9b288134/state
20:38:35.098Z INFO SledAgent (dropshot (SledAgent)): request completed
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:950
latency_us = 210
local_addr = [fd00:1122:3344:104::1]:12345
method = GET
remote_addr = [fd00:1122:3344:10e::3]:64130
req_id = a7997c8e-8f69-414e-83e1-8bf905229a39
response_code = 200
uri = /vmms/677d7236-412a-4141-8876-f09cc7dbee44/state
20:38:35.134Z INFO SledAgent (dropshot (SledAgent)): request completed
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:950
latency_us = 127
local_addr = [fd00:1122:3344:104::1]:12345
method = GET
remote_addr = [fd00:1122:3344:10e::3]:64130
req_id = 2bc807ce-f42e-4921-87a4-930a0b23b513
response_code = 200
uri = /vmms/90676c5f-a315-4930-a90f-43790839069b/state
// gjcolombo: 10 seconds elapse
// gjcolombo: note remote port number
20:38:45.544Z INFO SledAgent (dropshot (SledAgent)): accepted connection
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:1105
local_addr = [fd00:1122:3344:104::1]:12345
remote_addr = [fd00:1122:3344:111::3]:46877
// gjcolombo: 7 more seconds elapse
20:38:52.095Z INFO SledAgent (dropshot (BootstrapAgent)): accepted connection
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:1105
local_addr = [fdb0:a840:2504:350::1]:80
remote_addr = [fdb0:a840:2504:4d0::2]:48619
20:38:52.929Z INFO SledAgent (dropshot (BootstrapAgent)): accepted connection
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:1105
local_addr = [fdb0:a840:2504:350::1]:80
remote_addr = [fdb0:a840:2504:1d4::2]:41366
// gjcolombo: several successful requests redacted; these hit the /eip-gateways and /vpc-routes endpoints
// gjcolombo: 60-second client timeout; turns out this was a snapshot request...
20:39:45.265Z WARN SledAgent (dropshot (SledAgent)): request handling cancelled (client disconnected)
file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.12.0/src/server.rs:887
latency_us = 59718455
local_addr = [fd00:1122:3344:104::1]:12345
method = POST
remote_addr = [fd00:1122:3344:111::3]:46877
req_id = b52dafd4-82b6-4d6c-b044-c72619bd0078
uri = /vmms/3bfe0e53-b1e9-4473-8a92-298984d08e17/disks/31c1a97b-db69-4185-a198-78679c0f1f36/snapshot
I suspect what's happened is that this specific snapshot request is stuck. It's not timing out because it's being serviced via a call to Propolis, and sled agent's Propolis clients don't configure a timeout:
Why is this snapshot request stuck? Does this disk (31c1a97b-db69-4185-a198-78679c0f1f36) have a downstairs on another sled that's in bad repair? @askfongjojo, @augustuswm: Propolis logs from VMM 3bfe0e53-b1e9-4473-8a92-298984d08e17 might be helpful here, if we don't have them already and we're not immediately sure that something is wrong with this specific Crucible disk.
Allocating guest memory is (or should be) much faster than it was when we configured this Propolis client. Should we really be running this client without a timeout? (Another related question: is it safe to do that, or will timing out a Propolis operation throw something off between Propolis and sled agent?)
Because each individual instance has its own driver task, it seems like we could (and should) rework InstanceManager so that it doesn't block waiting for each individual reply for a specific instance. That is, functions like issue_snapshot_request seem like they could spawn a separate tokio task that sends a message to the Instance in question, awaits the reply, and then forwards the reply back to the task that originally handled the relevant HTTP request. I say "seems" here because I haven't looked too hard, and this may be harder than it first appears!
I should add that I also took a very quick peek at the core file, but all it reveals at first glance is that all of the tokio threads in the agent are currently idle. That's consistent with the observations above. I don't know if we have any techniques available to parse the tokio task wheel manually to figure out where the InstanceManager task most recently awaited.
Because each individual instance has its own driver task, it seems like we could (and should) rework InstanceManager so that it doesn't block waiting for each individual reply for a specific instance. That is, functions like issue_snapshot_request seem like they could spawn a separate tokio task that sends a message to the Instance in question, awaits the reply, and then forwards the reply back to the task that originally handled the relevant HTTP request. I say "seems" here because I haven't looked too hard, and this may be harder than it first appears!
I think this seems quite doable and is almost certainly a good idea. The only thing that should be synchronous in the InstanceManager ought to be the actual routing of requests to instances and management of the "table of running instances" state. Potentially, I think we might not even need to spawn a separate task here, although I'll have to take another look at the code.
Happy to take a crack at this change unless you were planning to imminently.
One additional note re this and #6904: Although transferring requests from the InstanceManager to an individual Instance without blocking would have allowed requests to other VMMs to go through, requests to the snapshotting VM could still block (since the InstanceRunner still won't be responding). An operation like InstanceManagerRunner::use_only_these_disks would therefore still block indefinitely if the InstanceManager decided that it needed to dispatch a call to the affected Instance. Making Instance calls not block the InstanceManager is still righteous, but we still need to figure out what to do about seemingly-stuck calls to Propolis.
Before we have a fix to avoid the blocking behavior, what would be a reasonable workaround in this case? Would restarting sled-agent free up InstanceManager to serve other requests? Would the snapshot task retry indefinitely because it's a saga (not sure at what point it would give up and unwind)?
Would restarting sled-agent free up InstanceManager to serve other requests?
Good call--I think this should work, at least as far as instance management is concerned. All the existing Propolis zones will be reaped when the new sled agent starts, but any affected instances should go to Failed and then be restarted. The new sled agent will otherwise have a brand new instance manager task with an empty instance table.
Would the snapshot task retry indefinitely because it's a saga (not sure at what point it would give up and unwind)?
The next snapshot saga retry should produce a permanent error, since this request is directed at a particular VMM, and sled agent will now return "no such VMM" instead of stalling and timing out. Assuming the saga recognizes that it now has a permanent error it should unwind at that point.
PR #6913 fixes the issue where a sled-agent with one instance which has gotten stuck will not handle requests for any other instances on the sled. PR #6915 (which just merged) which fixes the sled-agent not being able to forcefully terminate instances when it is waiting for an in-flight operation to complete.
Collectively, those two changes fix this issue as far as the sled-agent is concerned. Unless we want to keep this issue open until the underlying Crucible issue is resolved, I think we can close this --- and I think#6932 picked up the Crucible fix, but I'd want @leftwo to confirm?
Unless we want to keep this issue open until the underlying Crucible issue is resolved, I think we can close this
The underlying issue was because a sled has gone away (potentially an electrical issue), not a crucible problem. We can close this ticket.
Hm, I thought it was a Crucible problem insofar as the instance had gotten stuck because it was trying to take a snapshot while in a degraded state because one of its downstairs replicas was on the sled that had gone away, and that condition was being handled by retrying the snapshot in a loop forever? In any case, happy to close this!
The situation was a bit unusal as we chose not to expunge the sled. If we had gone through expungement, the missing region downstairs would have been replaced on another sled and brought the disk back to a healthy state which in turn allowed the snapshot to complete. If @leftwo thinks we should handle the prolonged degraded state in a better way, we probably want to have a new crucible ticket filed for that (so closing this ticket is still the right thing to do!).
Activity
gjcolombo commentedon Oct 21, 2024
Probably related to #6904. I found a relevant-looking sled agent log snippet (from
oxide-sled-agent:default.log.1729284364); this is the point where the system crossed over from successfully servicing VMM requests to failing to do so:I suspect what's happened is that this specific snapshot request is stuck. It's not timing out because it's being serviced via a call to Propolis, and sled agent's Propolis clients don't configure a timeout:
omicron/sled-agent/src/instance.rs
Lines 1654 to 1660 in ca63e9f
Things to follow up on:
31c1a97b-db69-4185-a198-78679c0f1f36) have a downstairs on another sled that's in bad repair? @askfongjojo, @augustuswm: Propolis logs from VMM3bfe0e53-b1e9-4473-8a92-298984d08e17might be helpful here, if we don't have them already and we're not immediately sure that something is wrong with this specific Crucible disk.InstanceManagerso that it doesn't block waiting for each individual reply for a specific instance. That is, functions likeissue_snapshot_requestseem like they could spawn a separate tokio task that sends a message to theInstancein question, awaits the reply, and then forwards the reply back to the task that originally handled the relevant HTTP request. I say "seems" here because I haven't looked too hard, and this may be harder than it first appears!gjcolombo commentedon Oct 21, 2024
I should add that I also took a very quick peek at the core file, but all it reveals at first glance is that all of the
tokiothreads in the agent are currently idle. That's consistent with the observations above. I don't know if we have any techniques available to parse the tokio task wheel manually to figure out where theInstanceManagertask most recentlyawaited.hawkw commentedon Oct 21, 2024
@gjcolombo
I think this seems quite doable and is almost certainly a good idea. The only thing that should be synchronous in the
InstanceManagerought to be the actual routing of requests to instances and management of the "table of running instances" state. Potentially, I think we might not even need to spawn a separate task here, although I'll have to take another look at the code.Happy to take a crack at this change unless you were planning to imminently.
gjcolombo commentedon Oct 21, 2024
It's all yours if you want it! Let me know if you'd like me to pitch in.
gjcolombo commentedon Oct 21, 2024
One additional note re this and #6904: Although transferring requests from the
InstanceManagerto an individualInstancewithout blocking would have allowed requests to other VMMs to go through, requests to the snapshotting VM could still block (since theInstanceRunnerstill won't be responding). An operation likeInstanceManagerRunner::use_only_these_diskswould therefore still block indefinitely if theInstanceManagerdecided that it needed to dispatch a call to the affectedInstance. MakingInstancecalls not block theInstanceManageris still righteous, but we still need to figure out what to do about seemingly-stuck calls to Propolis.askfongjojo commentedon Oct 21, 2024
Yes, it indeed has a downstairs on sled 9 (BRM42220063) so that would explain why the snapshot task was stuck:
askfongjojo commentedon Oct 21, 2024
Before we have a fix to avoid the blocking behavior, what would be a reasonable workaround in this case? Would restarting
sled-agentfree upInstanceManagerto serve other requests? Would the snapshot task retry indefinitely because it's a saga (not sure at what point it would give up and unwind)?gjcolombo commentedon Oct 21, 2024
Good call--I think this should work, at least as far as instance management is concerned. All the existing Propolis zones will be reaped when the new sled agent starts, but any affected instances should go to Failed and then be restarted. The new sled agent will otherwise have a brand new instance manager task with an empty instance table.
The next snapshot saga retry should produce a permanent error, since this request is directed at a particular VMM, and sled agent will now return "no such VMM" instead of stalling and timing out. Assuming the saga recognizes that it now has a permanent error it should unwind at that point.
askfongjojo commentedon Oct 21, 2024
Thanks @gjcolombo. @augustuswm - There is no rush but it sounds like we can put sled 13 back in service with a sled-agent restart.
augustuswm commentedon Oct 21, 2024
Sounds good. I will do that now.
augustuswm commentedon Oct 21, 2024
That looks to have worked. VMs on sled 13 were replaced, and then stop + start operations afterwards were successful.
[sled-agent] Don't block InstanceManager on full MPSCs
[sled-agent] Don't block InstanceManager on full MPSCs (#6913)
[sled-agent] Give `InstanceManager` a gun (#6915)
hawkw commentedon Oct 30, 2024
PR #6913 fixes the issue where a sled-agent with one instance which has gotten stuck will not handle requests for any other instances on the sled. PR #6915 (which just merged) which fixes the sled-agent not being able to forcefully terminate instances when it is waiting for an in-flight operation to complete.
Collectively, those two changes fix this issue as far as the sled-agent is concerned. Unless we want to keep this issue open until the underlying Crucible issue is resolved, I think we can close this --- and I think #6932 picked up the Crucible fix, but I'd want @leftwo to confirm?
askfongjojo commentedon Oct 30, 2024
The underlying issue was because a sled has gone away (potentially an electrical issue), not a crucible problem. We can close this ticket.
hawkw commentedon Oct 30, 2024
Hm, I thought it was a Crucible problem insofar as the instance had gotten stuck because it was trying to take a snapshot while in a degraded state because one of its downstairs replicas was on the sled that had gone away, and that condition was being handled by retrying the snapshot in a loop forever? In any case, happy to close this!
askfongjojo commentedon Oct 30, 2024
The situation was a bit unusal as we chose not to expunge the sled. If we had gone through expungement, the missing region downstairs would have been replaced on another sled and brought the disk back to a healthy state which in turn allowed the snapshot to complete. If @leftwo thinks we should handle the prolonged degraded state in a better way, we probably want to have a new crucible ticket filed for that (so closing this ticket is still the right thing to do!).
hawkw commentedon Oct 30, 2024
Yup, that makes sense! Thanks for clarifying!