Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 error caused by CRDB TransactionRetryWithProtoRefreshError during concurrent disk deletion #7208

Closed
askfongjojo opened this issue Dec 5, 2024 · 14 comments
Assignees
Milestone

Comments

@askfongjojo
Copy link

On omicron commit 37c7f18, I ran into 4 disk deletion failures out of 20 instances when using Terraform (with default concurrency) to destroy instances and disks. The same TF plan used to work without error on up to 120 instances/disks consistently.

BRM44220011 # grep 'Internal Server Error' /pool/ext/b93f880e-c55b-4d6c-9a16-939d84b628fc/crypt/debug/oxz_nexus_65a11c18-7f59-41ac-b9e7-680627f996e7/oxide-nexus:default.log.1733365800 | looker
02:12:44.046Z INFO 65a11c18-7f59-41ac-b9e7-680627f996e7 (dropshot_external): request completed
    error_message_external = Internal Server Error
    error_message_internal = saga ACTION error at node "crucible_resources_to_delete": deserialize failed: unknown variant `failed to soft_delete_volume: InternalError { internal_message: "unexpected database error: restart transaction: TransactionRetryWithProtoRefreshError: TransactionAbortedError(ABORT_REASON_PUSHER_ABORTED): \\"sql txn\\" meta={id=9bf9e678 key=/Table/509/2/NULL/\\"5?EM\\\\xbc\\\\xa5G\\\\xb4\\\\xa0\\\\xb6\\\\x1fX\\\\xaaFfE\\"/0 pri=0.08992748 epo=0 ts=1733364762.938330357,0 min=1733364743.886780600,0 seq=4} lock=true stat=ABORTED rts=1733364743.886780600,0 wto=false gul=1733364744.386780600,0" }`, expected one of `ObjectNotFound`, `ObjectAlreadyExists`, `InvalidRequest`, `Unauthenticated`, `InvalidValue`, `Forbidden`, `InternalError`, `ServiceUnavailable`, `InsufficientCapacity`, `TypeVersionMismatch`, `Conflict`, `NotFound`, `Gone`
    file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.13.0/src/server.rs:851
    latency_us = 297159887
    local_addr = 172.30.2.5:443
    method = DELETE
    remote_addr = 172.20.17.42:56169
    req_id = a8be3221-980d-4bcf-8773-36e58ca2d95a
    response_code = 500
    uri = https://oxide.sys.rack2.eng.oxide.computer/v1/disks/95860ec0-26de-4bc0-9280-2d5083a3494b
02:15:01.292Z INFO 65a11c18-7f59-41ac-b9e7-680627f996e7 (dropshot_external): request completed
    error_message_external = Internal Server Error
    error_message_internal = saga ACTION error at node "crucible_resources_to_delete": deserialize failed: unknown variant `failed to soft_delete_volume: InternalError { internal_message: "unexpected database error: restart transaction: TransactionRetryWithProtoRefreshError: TransactionRetryError: retry txn (RETRY_SERIALIZABLE - failed preemptive refresh - unknown error: <nil>): \\"sql txn\\" meta={id=8f02dbf2 key=/Table/509/2/NULL/\\"\\\\\\"\\\\xbc\\\\ud7fe\\\\xf9J:\\\\x9a+\\\\xfaJ\\\\xf4\\\\xdf]\\\\xaf\\"/0 pri=0.08992748 epo=0 ts=1733364864.388766638,2 min=1733364763.830147584,0 seq=15} lock=true stat=PENDING rts=1733364763.830147584,0 wto=false gul=1733364764.330147584,0" }`, expected one of `ObjectNotFound`, `ObjectAlreadyExists`, `InvalidRequest`, `Unauthenticated`, `InvalidValue`, `Forbidden`, `InternalError`, `ServiceUnavailable`, `InsufficientCapacity`, `TypeVersionMismatch`, `Conflict`, `NotFound`, `Gone`
    file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.13.0/src/server.rs:851
    latency_us = 434398488
    local_addr = 172.30.2.5:443
    method = DELETE
    remote_addr = 172.20.17.42:56169
    req_id = 6cc11b17-e2a3-4fd0-82fe-66f9e057d52b
    response_code = 500
    uri = https://oxide.sys.rack2.eng.oxide.computer/v1/disks/5529a054-31bd-459b-a8a2-a1f0eb56841a
02:16:11.598Z INFO 65a11c18-7f59-41ac-b9e7-680627f996e7 (dropshot_external): request completed
    error_message_external = Internal Server Error
    error_message_internal = saga ACTION error at node "crucible_resources_to_delete": deserialize failed: unknown variant `failed to soft_delete_volume: InternalError { internal_message: "unexpected database error: restart transaction: TransactionRetryWithProtoRefreshError: ReadWithinUncertaintyIntervalError: read at time 1733364919.664460317,0 encountered previous write with future timestamp 1733364919.671276468,0 within uncertainty interval `t <= (local=1733364919.672538964,0, global=1733364920.164460317,0)`; observed timestamps: [{1 1733364919.728612415,0} {2 1733364919.732171649,0} {3 1733364919.728209025,0} {4 1733364919.672538964,0} {5 1733364919.727777891,0}]: \\"sql txn\\" meta={id=f5232862 key=/Table/509/2/NULL/\\"\\\\x95\\\\xa8\\\\xf3pS\\\\x9bEV\\\\x807\\\\xdff\\\\xd6G\\\\x90\\\\xcd\\"/0 pri=0.08992744 epo=0 ts=1733364954.121349205,2 min=1733364919.664460317,0 seq=4} lock=true stat=PENDING rts=1733364919.664460317,0 wto=false gul=1733364920.164460317,0" }`, expected one of `ObjectNotFound`, `ObjectAlreadyExists`, `InvalidRequest`, `Unauthenticated`, `InvalidValue`, `Forbidden`, `InternalError`, `ServiceUnavailable`, `InsufficientCapacity`, `TypeVersionMismatch`, `Conflict`, `NotFound`, `Gone`
    file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.13.0/src/server.rs:851
    latency_us = 504699835
    local_addr = 172.30.2.5:443
    method = DELETE
    remote_addr = 172.20.17.42:56169
    req_id = a379ef40-adbb-4c18-a9f2-73a5b9a2c957
    response_code = 500
    uri = https://oxide.sys.rack2.eng.oxide.computer/v1/disks/c6246897-69cf-408f-a4f5-fe41ef118fd2
02:16:32.286Z INFO 65a11c18-7f59-41ac-b9e7-680627f996e7 (dropshot_external): request completed
    error_message_external = Internal Server Error
    error_message_internal = saga ACTION error at node "crucible_resources_to_delete": deserialize failed: unknown variant `failed to soft_delete_volume: InternalError { internal_message: "unexpected database error: restart transaction: TransactionRetryWithProtoRefreshError: TransactionAbortedError(ABORT_REASON_PUSHER_ABORTED): \\"sql txn\\" meta={id=757b5e1e key=/Table/509/2/NULL/\\"T\\\\xecO*\\\\xe4\\\\xf1O\u{62b}\\\\x8f\\\\xc6g\\\\x17\\\\xa2\\\\xf5K\\"/0 pri=0.12047747 epo=1 ts=1733364991.657223426,0 min=1733364919.604057462,0 seq=15} lock=true stat=ABORTED rts=1733364990.477995727,0 wto=false gul=1733364920.104057462,0" }`, expected one of `ObjectNotFound`, `ObjectAlreadyExists`, `InvalidRequest`, `Unauthenticated`, `InvalidValue`, `Forbidden`, `InternalError`, `ServiceUnavailable`, `InsufficientCapacity`, `TypeVersionMismatch`, `Conflict`, `NotFound`, `Gone`
    file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.13.0/src/server.rs:851
    latency_us = 525067279
    local_addr = 172.30.2.5:443
    method = DELETE
    remote_addr = 172.20.17.42:56169
    req_id = acfddc7f-3489-4807-ae1e-ac4270caf192
    response_code = 500
    uri = https://oxide.sys.rack2.eng.oxide.computer/v1/disks/fe612560-84cf-46d4-8932-621329030820
@askfongjojo askfongjojo added this to the 12 milestone Dec 5, 2024
@jmpesp
Copy link
Contributor

jmpesp commented Dec 5, 2024

I'm surprised that these aren't being retried:

self.transaction_retry_wrapper("soft_delete_volume")

One thing that would explain it: are you seeing that these are being retried 10 times?

warn!(
self.log,
"Retryable transaction failure";
"retry_after (ms)" => duration.as_millis(),
);
tokio::time::sleep(duration).await;
// Now that we've finished sleeping, reset the timer and bump the number
// of attempts we've tried.
let inner = self.inner.lock().unwrap().tick();
return inner.attempts < MAX_RETRY_ATTEMPTS;

@askfongjojo
Copy link
Author

I haven't snooped the CRBD queries but this likely has to do with the slow disk deletion issue. It's conceivable that the number of retries has been exhausted for some of the disks when multiple of them are being deleted. The slow query I referenced in that ticket is unfortunately hitting the same rows in the virtual_provisioning_resource table for every single disk of that particular project/silo.

@smklein
Copy link
Collaborator

smklein commented Dec 5, 2024

We should automatically be producing metrics for oximeter when transactions are retried. The schema is defined in: https://github.com/oxidecomputer/omicron/blob/1922c8ecb8a667c9b1efa876f75d72a7437b3c77/oximeter/oximeter/schema/database-transaction.toml

This should include both the name of the transaction and how many times it has been retried

@smklein
Copy link
Collaborator

smklein commented Dec 5, 2024

Following https://github.com/oxidecomputer/omicron/blob/main/docs/clickhouse-debugging.adoc , I'm taking a look at this for dogfood. From the clickhouse zone, I ran the following query:

SELECT
    fields_string.field_value AS transaction_name,
    fields_u32.field_value AS attempt,
    measurements_f64.datum AS attempt_duration,
    measurements_f64.timestamp
FROM measurements_f64
INNER JOIN fields_string ON fields_string.timeseries_key = measurements_f64.timeseries_key
INNER JOIN fields_u32 ON fields_u32.timeseries_key = measurements_f64.timeseries_key
WHERE (measurements_f64.timeseries_name = 'database_transaction:retry_data') AND (attempt > 5)
ORDER BY measurements_f64.timestamp ASC

This is basically showing all transactions that take "five or more attempts to finish", ordered by "when they happened".

Here are the results:

┌─transaction_name────────┬─attempt─┬───attempt_duration─┬────measurements_f64.timestamp─┐
│ sled_reservation_create │       6 │        0.008785838 │ 2024-11-07 22:37:17.746644146 │
│ sled_reservation_create │       6 │ 1.4373198999999999 │ 2024-11-07 22:37:17.784590269 │
│ sled_reservation_create │       6 │        1.543870263 │ 2024-11-07 22:37:17.785515099 │
│ sled_reservation_create │       6 │        1.057816106 │ 2024-11-07 22:37:17.786106735 │
│ sled_reservation_create │       7 │        0.108157228 │ 2024-11-07 22:37:17.915347785 │
│ sled_reservation_create │       7 │        0.228064555 │ 2024-11-07 22:37:18.029243064 │
│ sled_reservation_create │       6 │        0.265567131 │ 2024-11-07 22:37:18.085839425 │
│ sled_reservation_create │       6 │        0.479090396 │ 2024-11-07 22:37:18.309747362 │
│ sled_reservation_create │       6 │        0.689304229 │ 2024-11-07 22:37:18.481899073 │
│ sled_reservation_create │       7 │        0.827625068 │ 2024-11-07 22:37:18.646025735 │
│ sled_reservation_create │       6 │        0.949526193 │ 2024-11-07 22:37:18.760382859 │
│ sled_reservation_create │       7 │        1.118070523 │ 2024-11-07 22:37:18.894265931 │
│ sled_reservation_create │       8 │        0.227034627 │ 2024-11-07 22:37:18.898309745 │
│ sled_reservation_create │       6 │        0.917451196 │ 2024-11-07 22:37:18.900237177 │
│ sled_reservation_create │       7 │        0.540270085 │ 2024-11-07 22:37:18.900482470 │
│ sled_reservation_create │       8 │        0.940038197 │ 2024-11-07 22:37:18.902388343 │
│ sled_reservation_create │       7 │         0.81442474 │ 2024-11-07 22:37:18.904516038 │
│ sled_reservation_create │       7 │        0.411805714 │ 2024-11-07 22:37:18.904681501 │
│ sled_reservation_create │       8 │         0.82614987 │ 2024-11-07 22:37:18.905490492 │
│ sled_reservation_create │       8 │        0.296193232 │ 2024-11-07 22:37:19.219684369 │
│ sled_reservation_create │       9 │        0.309537131 │ 2024-11-07 22:37:19.220593298 │
│ sled_reservation_create │       9 │        0.268138137 │ 2024-11-07 22:37:19.220648868 │
│ sled_reservation_create │       6 │        0.287741406 │ 2024-11-07 22:37:19.227852064 │
│ sled_reservation_create │       6 │        0.357258127 │ 2024-11-07 22:37:19.284994172 │
│ sled_reservation_create │       6 │         0.39485796 │ 2024-11-07 22:37:19.341323718 │
│ sled_reservation_create │       8 │        0.444537296 │ 2024-11-07 22:37:19.397030874 │
│ sled_reservation_create │       7 │        0.571114911 │ 2024-11-07 22:37:19.511060598 │
│ sled_reservation_create │       8 │        0.645241673 │ 2024-11-07 22:37:19.568718822 │
│ sled_reservation_create │       9 │        0.701004361 │ 2024-11-07 22:37:19.625492175 │
│ sled_reservation_create │       8 │        0.773671863 │ 2024-11-07 22:37:19.682313568 │
│ sled_reservation_create │       6 │        0.837650229 │ 2024-11-07 22:37:19.738893210 │
│ sled_reservation_create │       6 │        0.872164791 │ 2024-11-07 22:37:19.795424889 │
│ sled_reservation_create │      10 │        0.653962092 │ 2024-11-07 22:37:19.876714830 │
│ sled_reservation_create │       8 │        0.346352114 │ 2024-11-07 22:37:19.876840668 │
│ sled_reservation_create │       7 │        0.642972179 │ 2024-11-07 22:37:19.876959567 │
│ sled_reservation_create │       9 │        0.295534654 │ 2024-11-07 22:37:19.877062122 │
│ sled_reservation_create │      10 │        0.655249688 │ 2024-11-07 22:37:19.877114551 │
│ sled_reservation_create │      10 │        0.235459704 │ 2024-11-07 22:37:19.877153128 │
│ sled_reservation_create │       9 │        0.651816339 │ 2024-11-07 22:37:19.877466649 │
│ sled_reservation_create │       7 │        0.531916997 │ 2024-11-07 22:37:19.877509430 │
│ sled_reservation_create │       6 │        0.388755829 │ 2024-11-07 22:37:19.877567350 │
│ sled_reservation_create │       9 │        0.467915965 │ 2024-11-07 22:37:19.877602807 │
│ sled_reservation_create │       7 │        0.063312607 │ 2024-11-07 22:37:19.877632253 │
│ sled_reservation_create │       7 │        0.128605639 │ 2024-11-07 22:37:19.877709880 │
│ sled_reservation_create │       7 │        0.587761715 │ 2024-11-07 22:37:19.877773571 │
│ sled_reservation_create │       8 │        0.082866763 │ 2024-11-07 22:37:19.976972982 │
│ sled_reservation_create │      10 │         0.12535175 │ 2024-11-07 22:37:20.034087058 │
│ sled_reservation_create │       8 │        0.240826091 │ 2024-11-07 22:37:20.142501943 │
│ sled_reservation_create │       8 │        0.277644041 │ 2024-11-07 22:37:20.199467365 │
│ sled_reservation_create │       8 │        0.343030061 │ 2024-11-07 22:37:20.257092678 │
│ sled_reservation_create │      10 │        0.432067683 │ 2024-11-07 22:37:20.313053334 │
│ sled_reservation_create │       9 │        0.474535153 │ 2024-11-07 22:37:20.369309132 │
│ sled_reservation_create │      10 │        0.591071582 │ 2024-11-07 22:37:20.475297427 │
│ sled_reservation_create │       8 │        0.582008686 │ 2024-11-07 22:37:20.483393407 │
│ sled_reservation_create │       9 │        0.385521238 │ 2024-11-07 22:37:20.535262517 │
│ sled_reservation_create │       9 │        0.254702041 │ 2024-11-07 22:37:20.537090102 │
│ sled_reservation_create │       9 │        0.334548217 │ 2024-11-07 22:37:20.537187296 │
│ sled_reservation_create │      10 │        0.159662853 │ 2024-11-07 22:37:20.537228734 │
│ sled_reservation_create │       9 │         0.55363558 │ 2024-11-07 22:37:20.537818403 │
│ sled_reservation_create │      10 │        0.108464374 │ 2024-11-07 22:37:20.693036701 │
│ sled_reservation_create │      10 │        0.205229738 │ 2024-11-07 22:37:20.749397719 │
│ sled_reservation_create │      10 │        0.245846599 │ 2024-11-07 22:37:20.806334747 │
│ sled_reservation_create │       6 │        0.429748797 │ 2024-11-19 08:08:53.315405716 │
│ sled_reservation_create │       7 │         0.03048624 │ 2024-11-19 08:08:53.396145717 │
│ sled_reservation_create │       8 │        0.064953339 │ 2024-11-19 08:08:53.493135296 │
│ sled_reservation_create │       6 │        0.068512241 │ 2024-11-19 08:08:53.514307597 │
│ sled_reservation_create │       6 │        0.131075768 │ 2024-11-19 08:08:53.631209231 │
│ sled_reservation_create │       9 │        0.178772632 │ 2024-11-19 08:08:53.691675221 │
│ sled_reservation_create │       7 │        0.270777834 │ 2024-11-19 08:08:53.798233111 │
│ sled_reservation_create │       6 │        0.408764426 │ 2024-11-19 08:08:53.908919339 │
│ sled_reservation_create │      10 │        0.430668018 │ 2024-11-19 08:08:54.153753276 │
│ sled_reservation_create │       7 │        0.227385821 │ 2024-11-19 08:08:54.154545114 │
│ sled_reservation_create │       8 │        0.341459939 │ 2024-11-19 08:08:54.156922421 │
│ sled_reservation_create │       9 │        0.453941052 │ 2024-11-19 08:08:54.615001820 │
│ sled_reservation_create │      10 │        0.383097993 │ 2024-11-19 08:08:54.999377981 │
│ sled_reservation_create │       6 │        0.169462013 │ 2024-11-19 08:08:56.325093442 │
│ sled_reservation_create │       6 │        0.231578206 │ 2024-11-19 08:08:56.385710345 │
│ sled_reservation_create │       6 │        0.604598799 │ 2024-11-19 08:08:56.736220423 │
│ sled_reservation_create │       6 │        0.766991458 │ 2024-11-19 08:08:56.913157157 │
│ sled_reservation_create │       7 │        0.197813611 │ 2024-11-19 08:08:57.134188181 │
│ sled_reservation_create │       7 │        0.368359943 │ 2024-11-19 08:08:57.154005018 │
│ sled_reservation_create │       7 │        0.780628985 │ 2024-11-19 08:08:57.154984246 │
│ sled_reservation_create │       7 │        0.724773765 │ 2024-11-19 08:08:57.159725891 │
│ sled_reservation_create │       8 │        0.115250351 │ 2024-11-19 08:08:57.288332863 │
│ sled_reservation_create │       8 │        0.283229915 │ 2024-11-19 08:08:57.462098187 │
│ sled_reservation_create │       6 │        0.353688813 │ 2024-11-19 08:08:57.511247702 │
│ sled_reservation_create │       6 │         0.34145756 │ 2024-11-19 08:08:57.511314900 │
│ sled_reservation_create │       8 │        0.383409365 │ 2024-11-19 08:08:57.521049933 │
│ sled_reservation_create │       6 │        0.457675586 │ 2024-11-19 08:08:57.630772557 │
│ sled_reservation_create │       8 │        0.506602567 │ 2024-11-19 08:08:57.694166807 │
│ sled_reservation_create │       6 │        0.563579185 │ 2024-11-19 08:08:57.755699296 │
│ sled_reservation_create │       7 │        0.017822463 │ 2024-11-19 08:08:57.801553657 │
│ sled_reservation_create │       6 │        0.660023165 │ 2024-11-19 08:08:57.815024806 │
│ sled_reservation_create │       6 │        0.690700754 │ 2024-11-19 08:08:57.881304061 │
│ sled_reservation_create │       8 │        0.257106479 │ 2024-11-19 08:08:58.083032341 │
│ sled_reservation_create │       7 │        0.560507779 │ 2024-11-19 08:08:58.089735191 │
│ sled_reservation_create │       9 │        0.792952405 │ 2024-11-19 08:08:58.096527826 │
│ sled_reservation_create │       7 │        0.435932514 │ 2024-11-19 08:08:58.097128502 │
│ sled_reservation_create │       9 │        0.549174965 │ 2024-11-19 08:08:58.105102094 │
│ sled_reservation_create │       9 │        0.406005983 │ 2024-11-19 08:08:58.105421002 │
│ sled_reservation_create │       9 │        0.622339836 │ 2024-11-19 08:08:58.105656832 │
│ sled_reservation_create │       7 │        0.586388689 │ 2024-11-19 08:08:58.106872932 │
│ sled_reservation_create │       7 │        0.251043861 │ 2024-11-19 08:08:58.109316404 │
│ sled_reservation_create │      10 │        0.115900501 │ 2024-11-19 08:08:58.234797852 │
│ sled_reservation_create │      10 │        0.209963732 │ 2024-11-19 08:08:58.341955535 │
│ sled_reservation_create │      10 │        0.290924363 │ 2024-11-19 08:08:58.402690130 │
│ sled_reservation_create │       8 │        0.357978888 │ 2024-11-19 08:08:58.462040457 │
│ sled_reservation_create │      10 │        0.410977336 │ 2024-11-19 08:08:58.522754675 │
│ sled_reservation_create │       8 │        0.434790418 │ 2024-11-19 08:08:58.582445592 │
│ sled_reservation_create │       9 │        0.526936037 │ 2024-11-19 08:08:58.640664449 │
│ sled_reservation_create │       8 │        0.637180159 │ 2024-11-19 08:08:58.757902131 │
│ sled_reservation_create │       9 │        0.428661355 │ 2024-11-19 08:08:58.899465170 │
│ sled_reservation_create │       9 │        0.296123203 │ 2024-11-19 08:08:58.906055984 │
│ sled_reservation_create │      10 │        0.230899632 │ 2024-11-19 08:08:58.907790814 │
│ sled_reservation_create │      10 │        0.113002301 │ 2024-11-19 08:08:59.015694728 │
│ sled_reservation_create │       6 │        0.551227052 │ 2024-11-19 08:09:04.540992447 │
│ sled_reservation_create │       7 │        0.475201048 │ 2024-11-19 08:09:05.033073476 │
│ sled_reservation_create │       6 │        0.096929917 │ 2024-11-19 08:09:05.181446784 │
│ sled_reservation_create │       6 │        0.228756344 │ 2024-11-19 08:09:05.292548759 │
│ sled_reservation_create │       6 │        0.285242455 │ 2024-11-19 08:09:05.351212660 │
│ sled_reservation_create │       6 │        0.390198974 │ 2024-11-19 08:09:05.462460981 │
│ sled_reservation_create │       6 │        0.484763887 │ 2024-11-19 08:09:05.526208819 │
│ sled_reservation_create │       6 │        0.499770455 │ 2024-11-19 08:09:05.586672666 │
│ sled_reservation_create │       6 │        0.594249806 │ 2024-11-19 08:09:05.647927047 │
│ sled_reservation_create │       6 │        0.657914226 │ 2024-11-19 08:09:05.709020863 │
│ sled_reservation_create │       7 │        0.410774736 │ 2024-11-19 08:09:05.938162757 │
│ sled_reservation_create │       7 │        0.458367015 │ 2024-11-19 08:09:05.938249260 │
│ sled_reservation_create │       7 │        0.324541445 │ 2024-11-19 08:09:05.949671368 │
│ sled_reservation_create │       7 │        0.594518998 │ 2024-11-19 08:09:05.951436750 │
│ sled_reservation_create │       7 │        0.193722563 │ 2024-11-19 08:09:05.951501054 │
│ sled_reservation_create │       7 │        0.608480813 │ 2024-11-19 08:09:05.952070655 │
│ sled_reservation_create │       7 │        0.730753209 │ 2024-11-19 08:09:05.952222722 │
│ sled_reservation_create │       8 │        0.112416461 │ 2024-11-19 08:09:06.073304426 │
│ sled_reservation_create │       8 │        0.226278958 │ 2024-11-19 08:09:06.193600002 │
│ sled_reservation_create │       8 │        0.316038389 │ 2024-11-19 08:09:06.264129198 │
│ sled_reservation_create │       8 │        0.336038445 │ 2024-11-19 08:09:06.326964169 │
│ sled_reservation_create │       8 │        0.391008927 │ 2024-11-19 08:09:06.389434569 │
│ sled_reservation_create │       8 │        0.507776639 │ 2024-11-19 08:09:06.448694227 │
│ sled_reservation_create │       9 │        0.187496205 │ 2024-11-19 08:09:06.598522708 │
│ sled_reservation_create │       9 │        0.254724718 │ 2024-11-19 08:09:06.607961895 │
│ sled_reservation_create │       9 │         0.37858723 │ 2024-11-19 08:09:06.608170640 │
│ sled_reservation_create │       9 │        0.338562477 │ 2024-11-19 08:09:06.609384987 │
│ sled_reservation_create │       9 │        0.516867034 │ 2024-11-19 08:09:06.615496697 │
│ sled_reservation_create │      10 │        0.070376076 │ 2024-11-19 08:09:06.692893904 │
│ sled_reservation_create │      10 │        0.126323367 │ 2024-11-19 08:09:06.767302839 │
│ sled_reservation_create │      10 │        0.140909669 │ 2024-11-19 08:09:06.767491746 │
│ sled_reservation_create │      10 │        0.180206877 │ 2024-11-19 08:09:06.821167653 │
│ sled_reservation_create │       6 │        0.369326223 │ 2024-11-19 08:09:11.602150029 │
│ sled_reservation_create │       7 │        0.532768565 │ 2024-11-19 08:09:12.180297283 │
│ sled_reservation_create │       6 │        0.125356708 │ 2024-11-19 08:09:12.388464550 │
│ sled_reservation_create │       6 │         0.70598147 │ 2024-11-19 08:09:12.931637225 │
│ sled_reservation_create │       6 │        0.845770692 │ 2024-11-19 08:09:13.016403664 │
│ sled_reservation_create │       7 │        0.306911265 │ 2024-11-19 08:09:13.363529471 │
│ sled_reservation_create │       7 │        0.965032682 │ 2024-11-19 08:09:13.380721932 │
│ sled_reservation_create │       7 │        0.401114415 │ 2024-11-19 08:09:13.383750411 │
│ sled_reservation_create │       8 │        0.092023063 │ 2024-11-19 08:09:13.513895058 │
│ sled_reservation_create │       6 │        0.150649652 │ 2024-11-19 08:09:13.579802509 │
│ sled_reservation_create │       6 │         0.21582422 │ 2024-11-19 08:09:13.650150548 │
│ sled_reservation_create │       6 │        0.294768259 │ 2024-11-19 08:09:13.709521474 │
│ sled_reservation_create │       8 │        0.372589033 │ 2024-11-19 08:09:13.770406093 │
│ sled_reservation_create │       8 │        0.440941913 │ 2024-11-19 08:09:13.835171386 │
│ sled_reservation_create │       6 │        0.592648422 │ 2024-11-19 08:09:13.970792286 │
│ sled_reservation_create │       6 │        0.619570433 │ 2024-11-19 08:09:14.036018912 │
│ sled_reservation_create │       7 │        0.511851841 │ 2024-11-19 08:09:14.223614060 │
│ sled_reservation_create │       7 │        0.245342115 │ 2024-11-19 08:09:14.224372567 │
│ sled_reservation_create │       9 │        0.671615562 │ 2024-11-19 08:09:14.224723566 │
│ sled_reservation_create │       9 │        0.376976833 │ 2024-11-19 08:09:14.239380472 │
│ sled_reservation_create │       9 │        0.450942629 │ 2024-11-19 08:09:14.240107958 │
│ sled_reservation_create │       7 │        0.572369815 │ 2024-11-19 08:09:14.242356856 │
│ sled_reservation_create │       7 │        0.654131637 │ 2024-11-19 08:09:14.243153596 │
│ sled_reservation_create │      10 │        0.112993523 │ 2024-11-19 08:09:14.369111956 │
│ sled_reservation_create │       8 │        0.174304001 │ 2024-11-19 08:09:14.431061649 │
│ sled_reservation_create │       8 │        0.251047609 │ 2024-11-19 08:09:14.493149999 │
│ sled_reservation_create │      10 │        0.267466941 │ 2024-11-19 08:09:14.552881042 │
│ sled_reservation_create │       8 │        0.369224583 │ 2024-11-19 08:09:14.613483227 │
│ sled_reservation_create │       8 │        0.411605174 │ 2024-11-19 08:09:14.681487451 │
│ sled_reservation_create │       9 │         0.46180241 │ 2024-11-19 08:09:14.918040058 │
│ sled_reservation_create │       9 │        0.413309614 │ 2024-11-19 08:09:14.930657622 │
│ sled_reservation_create │       9 │        0.280225303 │ 2024-11-19 08:09:14.940986594 │
│ sled_reservation_create │      10 │        0.104374502 │ 2024-11-19 08:09:15.024606481 │
│ sled_reservation_create │      10 │        0.168775243 │ 2024-11-19 08:09:15.111238274 │
│ sled_reservation_create │       6 │        0.116615663 │ 2024-11-27 23:49:37.766514947 │
│ sled_reservation_create │       7 │        0.465739097 │ 2024-11-27 23:49:38.269509087 │
│ sled_reservation_create │       6 │        0.403702356 │ 2024-11-27 23:49:38.269750373 │
│ sled_reservation_create │       7 │        0.115817385 │ 2024-11-27 23:49:38.436401426 │
│ sled_reservation_create │       8 │        0.207390816 │ 2024-11-27 23:49:38.495883773 │
│ sled_reservation_create │       9 │        0.265343422 │ 2024-11-27 23:49:38.770473306 │
│ sled_reservation_create │       6 │        0.226857059 │ 2024-11-27 23:49:39.011341469 │
│ sled_reservation_create │      10 │        0.325293486 │ 2024-11-27 23:49:39.122552590 │
│ sled_reservation_create │       6 │        0.117541316 │ 2024-11-27 23:49:40.220956390 │
│ sled_reservation_create │       7 │        0.436033117 │ 2024-11-27 23:49:40.699530118 │
│ sled_reservation_create │       8 │        0.076820789 │ 2024-11-27 23:49:40.805860743 │
│ sled_reservation_create │       6 │        0.088075466 │ 2024-11-27 23:49:40.865304433 │
│ sled_reservation_create │       6 │        0.079245292 │ 2024-11-27 23:49:40.865421254 │
│ sled_reservation_create │       9 │        0.116345734 │ 2024-11-27 23:49:40.973489541 │
│ sled_reservation_create │       6 │        0.241923002 │ 2024-11-27 23:49:41.033834131 │
│ sled_reservation_create │       6 │        0.310317629 │ 2024-11-27 23:49:41.092827396 │
│ sled_reservation_create │       7 │         0.16420696 │ 2024-11-27 23:49:41.232332067 │
│ sled_reservation_create │       7 │        0.345047492 │ 2024-11-27 23:49:41.248629756 │
│ sled_reservation_create │      10 │        0.254058035 │ 2024-11-27 23:49:41.249782977 │
│ sled_reservation_create │       7 │         0.35658516 │ 2024-11-27 23:49:41.251171244 │
│ sled_reservation_create │       8 │         0.09437858 │ 2024-11-27 23:49:41.367618430 │
│ sled_reservation_create │       8 │        0.189506497 │ 2024-11-27 23:49:41.428137250 │
│ sled_reservation_create │       9 │        0.167492965 │ 2024-11-27 23:49:41.564342268 │
│ sled_reservation_create │       6 │        0.392592943 │ 2024-11-27 23:49:50.812522372 │
│ sled_reservation_create │       6 │        0.124707799 │ 2024-11-27 23:49:50.926053059 │
│ sled_reservation_create │       6 │        0.138698684 │ 2024-11-27 23:49:50.996900113 │
│ sled_reservation_create │       6 │        0.155086584 │ 2024-11-27 23:49:50.997055678 │
│ sled_reservation_create │       6 │         0.27355503 │ 2024-11-27 23:49:51.100459227 │
│ sled_reservation_create │       6 │        0.315680705 │ 2024-11-27 23:49:51.162599142 │
│ sled_reservation_create │       6 │        0.364740578 │ 2024-11-27 23:49:51.222940354 │
│ sled_reservation_create │       6 │        0.473457308 │ 2024-11-27 23:49:51.333547781 │
│ sled_reservation_create │       6 │        0.578407854 │ 2024-11-27 23:49:51.392062558 │
│ sled_reservation_create │       7 │        0.584917428 │ 2024-11-27 23:49:51.528724048 │
│ sled_reservation_create │       7 │        0.190221795 │ 2024-11-27 23:49:51.536674967 │
│ sled_reservation_create │       7 │        0.414990401 │ 2024-11-27 23:49:51.542867031 │
│ sled_reservation_create │       7 │        0.315995912 │ 2024-11-27 23:49:51.543197426 │
│ sled_reservation_create │       7 │        0.378633458 │ 2024-11-27 23:49:51.545323388 │
│ sled_reservation_create │       7 │        0.524010827 │ 2024-11-27 23:49:51.546333970 │
│ sled_reservation_create │       7 │        0.519758332 │ 2024-11-27 23:49:51.546760797 │
│ sled_reservation_create │       8 │        0.131493554 │ 2024-11-27 23:49:51.701790081 │
│ sled_reservation_create │       8 │        0.110886613 │ 2024-11-27 23:49:51.701878148 │
│ sled_reservation_create │       8 │        0.262792072 │ 2024-11-27 23:49:51.814791287 │
│ sled_reservation_create │       8 │        0.249587143 │ 2024-11-27 23:49:51.815209408 │
│ sled_reservation_create │       8 │        0.345829095 │ 2024-11-27 23:49:51.919437887 │
│ sled_reservation_create │       8 │        0.421652182 │ 2024-11-27 23:49:51.989639862 │
│ sled_reservation_create │       8 │        0.400213388 │ 2024-11-27 23:49:51.991229429 │
│ sled_reservation_create │       9 │        0.208808244 │ 2024-11-27 23:49:52.072499551 │
│ sled_reservation_create │       9 │        0.242324048 │ 2024-11-27 23:49:52.079190398 │
│ sled_reservation_create │       9 │        0.368267558 │ 2024-11-27 23:49:52.080269528 │
│ sled_reservation_create │       9 │        0.160674996 │ 2024-11-27 23:49:52.091390746 │
│ sled_reservation_create │       9 │        0.349517022 │ 2024-11-27 23:49:52.091906572 │
│ sled_reservation_create │       9 │        0.107769097 │ 2024-11-27 23:49:52.113074422 │
│ sled_reservation_create │      10 │         0.15764292 │ 2024-11-27 23:49:52.258214502 │
│ sled_reservation_create │      10 │        0.248293987 │ 2024-11-27 23:49:52.373164763 │
│ sled_reservation_create │      10 │        0.320637703 │ 2024-11-27 23:49:52.437803355 │
│ sled_reservation_create │      10 │        0.421770506 │ 2024-11-27 23:49:52.496566672 │
│ sled_reservation_create │      10 │        0.452450691 │ 2024-11-27 23:49:52.555277179 │
│ sled_reservation_create │       6 │        0.328825666 │ 2024-11-27 23:49:55.097773397 │
│ sled_reservation_create │       6 │        0.605284885 │ 2024-11-27 23:49:55.542812566 │
│ sled_reservation_create │       7 │        0.523129967 │ 2024-11-27 23:49:55.626134981 │
│ sled_reservation_create │       6 │        0.352184613 │ 2024-11-27 23:49:55.634695405 │
│ sled_reservation_create │       7 │        0.084515842 │ 2024-11-27 23:49:55.641071435 │
│ sled_reservation_create │       8 │        0.093758698 │ 2024-11-27 23:49:55.763169311 │
│ sled_reservation_create │       8 │        0.245224003 │ 2024-11-27 23:49:55.872773901 │
│ sled_reservation_create │       6 │        0.463134026 │ 2024-11-27 23:49:56.120099089 │
│ sled_reservation_create │       6 │        0.453692128 │ 2024-11-27 23:49:56.123023952 │
│ sled_reservation_create │       6 │        0.655000981 │ 2024-11-27 23:49:56.284803980 │
│ sled_reservation_create │       9 │        0.635134692 │ 2024-11-27 23:49:56.435905730 │
│ sled_reservation_create │       9 │        0.527818536 │ 2024-11-27 23:49:56.436695841 │
│ sled_reservation_create │       7 │        0.287262634 │ 2024-11-27 23:49:56.438532247 │
│ sled_reservation_create │       6 │        0.475490191 │ 2024-11-27 23:49:56.439489027 │
│ sled_reservation_create │       7 │        0.281022791 │ 2024-11-27 23:49:56.439894744 │
│ sled_reservation_create │       8 │        0.115787157 │ 2024-11-27 23:49:56.571068377 │
│ sled_reservation_create │       7 │        0.173363622 │ 2024-11-27 23:49:56.632422985 │
│ sled_reservation_create │      10 │        0.254466277 │ 2024-11-27 23:49:56.693026787 │
│ sled_reservation_create │      10 │        0.305298132 │ 2024-11-27 23:49:56.753117156 │
│ sled_reservation_create │       6 │        0.358517724 │ 2024-11-27 23:49:56.814066359 │
│ sled_reservation_create │       6 │        0.443618652 │ 2024-11-27 23:49:56.872708879 │
│ sled_reservation_create │       8 │        0.384030956 │ 2024-11-27 23:49:57.019720882 │
│ sled_reservation_create │       9 │        0.422714082 │ 2024-11-27 23:49:57.021253081 │
│ sled_reservation_create │       7 │        0.181584321 │ 2024-11-27 23:49:57.027712508 │
│ sled_reservation_create │       9 │        0.118456868 │ 2024-11-27 23:49:57.176225962 │
│ sled_reservation_create │       8 │          0.1811933 │ 2024-11-27 23:49:57.236691038 │
│ sled_reservation_create │      10 │        0.250721793 │ 2024-11-27 23:49:57.438190211 │
│ sled_reservation_create │       9 │        0.193948529 │ 2024-11-27 23:49:57.438916806 │
│ soft_delete_volume      │       6 │       61.523038586 │ 2024-11-28 02:17:18.422644937 │
│ soft_delete_volume      │       6 │       41.276636798 │ 2024-11-28 02:17:59.594299024 │
│ soft_delete_volume      │       7 │       41.304709448 │ 2024-11-28 02:17:59.768420626 │
│ soft_delete_volume      │       8 │        61.27009022 │ 2024-11-28 02:19:01.041744263 │
│ soft_delete_volume      │       6 │       32.657263344 │ 2024-11-28 03:00:39.282445631 │
│ soft_delete_volume      │       7 │        0.113254105 │ 2024-11-28 03:00:39.434938903 │
│ soft_delete_volume      │       6 │       37.404846183 │ 2024-11-28 03:01:37.744979244 │
│ sled_reservation_create │       6 │        0.127940099 │ 2024-11-28 03:06:47.150368887 │
│ soft_delete_volume      │       6 │         0.11367176 │ 2024-11-28 03:33:00.006408659 │
│ soft_delete_volume      │       6 │        0.115390631 │ 2024-11-28 03:33:20.306409168 │
│ soft_delete_volume      │       6 │       80.856726935 │ 2024-11-28 03:33:42.065805994 │
│ soft_delete_volume      │       6 │       81.078795807 │ 2024-11-28 03:33:42.395633327 │
│ soft_delete_volume      │       7 │       62.915420808 │ 2024-11-28 03:34:02.969124019 │
│ soft_delete_volume      │       7 │       42.739497142 │ 2024-11-28 03:34:03.078181308 │
│ soft_delete_volume      │       6 │        0.336790795 │ 2024-11-28 03:34:03.189030568 │
│ soft_delete_volume      │       6 │       42.662222314 │ 2024-11-28 03:34:24.611933473 │
│ soft_delete_volume      │       7 │       42.594820228 │ 2024-11-28 03:34:24.708840647 │
│ soft_delete_volume      │       8 │       21.765723489 │ 2024-11-28 03:34:24.766695199 │
│ soft_delete_volume      │       8 │       21.776414414 │ 2024-11-28 03:34:24.874445245 │
│ soft_delete_volume      │       6 │       42.721944477 │ 2024-11-28 03:34:24.932408242 │
│ soft_delete_volume      │       6 │       42.674518596 │ 2024-11-28 03:34:24.991281121 │
│ soft_delete_volume      │       7 │       42.646238245 │ 2024-11-28 03:34:25.050100518 │
│ soft_delete_volume      │       6 │       42.568608922 │ 2024-11-28 03:34:25.108923873 │
│ soft_delete_volume      │       6 │       42.532578789 │ 2024-11-28 03:34:25.167713364 │
│ soft_delete_volume      │       6 │       42.493797144 │ 2024-11-28 03:34:25.225628923 │
│ soft_delete_volume      │       6 │       42.456785517 │ 2024-11-28 03:34:25.284046777 │
│ soft_delete_volume      │       6 │       42.409902283 │ 2024-11-28 03:34:25.342296767 │
│ soft_delete_volume      │       7 │       22.184346336 │ 2024-11-28 03:34:25.400758076 │
│ soft_delete_volume      │       8 │       43.013729313 │ 2024-11-28 03:35:07.757368434 │
│ soft_delete_volume      │       9 │        0.067848489 │ 2024-11-28 03:35:07.858474149 │
│ soft_delete_volume      │       9 │       59.718126381 │ 2024-11-28 03:35:24.509097356 │
│ soft_delete_volume      │      10 │        0.065298194 │ 2024-11-28 03:35:24.586664672 │
│ soft_delete_volume      │       9 │       79.920195287 │ 2024-11-28 03:35:44.836967404 │
│ soft_delete_volume      │       7 │       79.982472715 │ 2024-11-28 03:35:44.948134757 │
│ soft_delete_volume      │       7 │        79.97811064 │ 2024-11-28 03:35:45.006676918 │
│ soft_delete_volume      │       8 │       79.969981602 │ 2024-11-28 03:35:45.064599709 │
│ soft_delete_volume      │       7 │       79.973124886 │ 2024-11-28 03:35:45.123289130 │
│ soft_delete_volume      │       7 │       80.008411365 │ 2024-11-28 03:35:45.181467826 │
│ soft_delete_volume      │       7 │       79.963723352 │ 2024-11-28 03:35:45.239628357 │
│ soft_delete_volume      │       7 │       79.996980728 │ 2024-11-28 03:35:45.297204582 │
│ soft_delete_volume      │       7 │       79.998308974 │ 2024-11-28 03:35:45.355854860 │
│ soft_delete_volume      │      10 │       37.518806503 │ 2024-11-28 03:35:45.415483636 │
│ soft_delete_volume      │       8 │       80.032895955 │ 2024-11-28 03:35:45.473305556 │
│ soft_delete_volume      │       8 │       41.467125446 │ 2024-11-28 03:36:26.420503631 │
│ soft_delete_volume      │       9 │        0.068257682 │ 2024-11-28 03:36:26.525005482 │
│ soft_delete_volume      │       8 │       62.803633553 │ 2024-11-28 03:36:47.816524227 │
│ soft_delete_volume      │       9 │        0.066985275 │ 2024-11-28 03:36:47.921678301 │
│ soft_delete_volume      │       9 │       83.808472994 │ 2024-11-28 03:37:08.914380992 │
│ soft_delete_volume      │       8 │       83.860839552 │ 2024-11-28 03:37:09.001779586 │
│ soft_delete_volume      │       8 │       83.830883651 │ 2024-11-28 03:37:09.060166224 │
│ soft_delete_volume      │      10 │        0.184086383 │ 2024-11-28 03:37:09.117756526 │
│ soft_delete_volume      │       8 │      100.134521842 │ 2024-11-28 03:37:25.380326086 │
│ soft_delete_volume      │       8 │         100.133954 │ 2024-11-28 03:37:25.446580207 │
│ soft_delete_volume      │       8 │      100.143783998 │ 2024-11-28 03:37:25.505846480 │
│ soft_delete_volume      │      10 │       59.012510241 │ 2024-11-28 03:37:25.564704190 │
│ soft_delete_volume      │      10 │        37.74414555 │ 2024-11-28 03:37:25.672879791 │
│ soft_delete_volume      │       9 │       16.714994127 │ 2024-11-28 03:37:25.731060791 │
│ soft_delete_volume      │       9 │       16.760070002 │ 2024-11-28 03:37:25.838475202 │
│ soft_delete_volume      │       9 │       100.37886788 │ 2024-11-28 03:37:25.897409787 │
│ soft_delete_volume      │       9 │       37.707667349 │ 2024-11-28 03:38:03.156472196 │
│ soft_delete_volume      │      10 │        37.53119503 │ 2024-11-28 03:38:03.285438139 │
│ soft_delete_volume      │       9 │       37.828856442 │ 2024-11-28 03:38:03.343915279 │
│ soft_delete_volume      │      10 │       54.701034786 │ 2024-11-28 03:38:20.568742151 │
│ soft_delete_volume      │      10 │       76.207760258 │ 2024-11-28 03:38:42.136926783 │
│ soft_delete_volume      │      10 │       61.822008595 │ 2024-11-28 03:39:04.991758529 │
│ soft_delete_volume      │      10 │       61.683417851 │ 2024-11-28 03:39:05.058622304 │
│ soft_delete_volume      │       6 │       23.319228894 │ 2024-11-30 22:32:33.026289016 │
│ soft_delete_volume      │       7 │       40.647775947 │ 2024-11-30 22:33:13.689826692 │
│ soft_delete_volume      │       6 │       13.388179029 │ 2024-11-30 22:33:13.766853415 │
└─────────────────────────┴─────────┴────────────────────┴───────────────────────────────┘
┌─transaction_name────────┬─attempt─┬─attempt_duration─┬────measurements_f64.timestamp─┐
│ sled_reservation_create │       6 │      0.861434555 │ 2024-12-05 01:33:24.771131983 │
│ sled_reservation_create │       7 │       0.70295086 │ 2024-12-05 01:33:25.496301935 │
│ sled_reservation_create │       6 │      0.918146746 │ 2024-12-05 01:33:25.713901515 │
│ sled_reservation_create │       6 │      1.194140606 │ 2024-12-05 01:33:26.000382945 │
│ sled_reservation_create │       7 │      0.316018443 │ 2024-12-05 01:33:26.359718699 │
│ sled_reservation_create │       8 │      0.166946223 │ 2024-12-05 01:33:26.560436375 │
│ sled_reservation_create │       9 │      0.009537282 │ 2024-12-05 01:33:26.599165006 │
│ sled_reservation_create │       6 │      0.878575379 │ 2024-12-05 01:33:26.613230633 │
│ sled_reservation_create │       6 │      0.822057988 │ 2024-12-05 01:33:26.615805704 │
│ sled_reservation_create │       8 │      1.098658037 │ 2024-12-05 01:33:26.621190749 │
│ sled_reservation_create │       7 │      0.879489999 │ 2024-12-05 01:33:26.621216538 │
│ sled_reservation_create │       6 │       1.83584594 │ 2024-12-05 01:33:26.621795453 │
│ sled_reservation_create │       6 │      0.027563049 │ 2024-12-05 01:33:26.625948369 │
│ sled_reservation_create │       6 │      0.106281897 │ 2024-12-05 01:33:26.747397901 │
│ sled_reservation_create │       7 │      0.265887982 │ 2024-12-05 01:33:26.906462963 │
│ sled_reservation_create │       6 │      0.262781221 │ 2024-12-05 01:33:26.912449713 │
│ sled_reservation_create │       7 │      0.315707666 │ 2024-12-05 01:33:26.970230569 │
│ sled_reservation_create │       7 │      0.387411068 │ 2024-12-05 01:33:27.027976103 │
│ sled_reservation_create │       6 │      0.475008919 │ 2024-12-05 01:33:27.135852445 │
│ sled_reservation_create │       6 │      0.547187074 │ 2024-12-05 01:33:27.191830494 │
│ sled_reservation_create │       6 │      0.667687084 │ 2024-12-05 01:33:27.303813698 │
│ sled_reservation_create │       6 │       0.72466789 │ 2024-12-05 01:33:27.361038899 │
│ sled_reservation_create │       6 │      0.826303517 │ 2024-12-05 01:33:27.467407800 │
│ sled_reservation_create │       6 │       0.81867693 │ 2024-12-05 01:33:27.475633560 │
│ sled_reservation_create │       9 │      0.860535154 │ 2024-12-05 01:33:27.531091405 │
│ sled_reservation_create │       6 │      0.926230498 │ 2024-12-05 01:33:27.587065469 │
│ sled_reservation_create │       6 │      1.020253365 │ 2024-12-05 01:33:27.645394429 │
│ sled_reservation_create │       6 │      1.068046189 │ 2024-12-05 01:33:27.704721925 │
│ sled_reservation_create │       7 │      1.124860994 │ 2024-12-05 01:33:27.760993419 │
│ sled_reservation_create │       7 │      0.659720093 │ 2024-12-05 01:33:27.842578437 │
│ sled_reservation_create │       7 │      0.095345746 │ 2024-12-05 01:33:27.842860530 │
│ sled_reservation_create │       8 │      0.828972909 │ 2024-12-05 01:33:27.863186791 │
│ sled_reservation_create │       7 │      0.459774248 │ 2024-12-05 01:33:27.865056946 │
│ sled_reservation_create │       7 │      0.529130866 │ 2024-12-05 01:33:27.867187699 │
│ sled_reservation_create │       7 │      0.350019047 │ 2024-12-05 01:33:27.867196557 │
│ sled_reservation_create │      10 │      0.331476114 │ 2024-12-05 01:33:27.868411785 │
│ sled_reservation_create │       7 │      0.280011085 │ 2024-12-05 01:33:27.869272118 │
│ sled_reservation_create │       8 │      0.944770617 │ 2024-12-05 01:33:27.870200429 │
│ sled_reservation_create │       7 │      1.106763218 │ 2024-12-05 01:33:27.870426610 │
│ sled_reservation_create │      10 │      1.262309788 │ 2024-12-05 01:33:27.870460240 │
│ sled_reservation_create │       6 │       1.23425126 │ 2024-12-05 01:33:27.870499905 │
│ sled_reservation_create │       7 │      0.665235323 │ 2024-12-05 01:33:27.870627239 │
│ sled_reservation_create │       7 │      0.372930845 │ 2024-12-05 01:33:27.870665631 │
│ sled_reservation_create │       7 │      0.189094404 │ 2024-12-05 01:33:27.870680660 │
│ sled_reservation_create │       7 │      0.949988093 │ 2024-12-05 01:33:27.870701289 │
│ sled_reservation_create │       8 │       0.85726782 │ 2024-12-05 01:33:27.870925420 │
│ sled_reservation_create │       8 │      0.029460819 │ 2024-12-05 01:33:27.877206920 │
│ sled_reservation_create │       7 │      0.057515048 │ 2024-12-05 01:33:27.953320082 │
│ sled_reservation_create │       8 │      0.168108135 │ 2024-12-05 01:33:28.056644760 │
│ sled_reservation_create │       9 │      0.267160914 │ 2024-12-05 01:33:28.171785028 │
│ sled_reservation_create │       8 │      0.319909782 │ 2024-12-05 01:33:28.227040066 │
│ sled_reservation_create │       8 │      0.382782578 │ 2024-12-05 01:33:28.284552394 │
│ sled_reservation_create │       8 │      0.425983735 │ 2024-12-05 01:33:28.339430173 │
│ sled_reservation_create │       8 │      0.516501716 │ 2024-12-05 01:33:28.396027103 │
│ sled_reservation_create │       9 │      0.569668228 │ 2024-12-05 01:33:28.454428057 │
│ sled_reservation_create │       8 │      0.638123542 │ 2024-12-05 01:33:28.510934255 │
│ sled_reservation_create │       8 │       0.72253075 │ 2024-12-05 01:33:28.618059656 │
│ sled_reservation_create │       8 │      0.755032787 │ 2024-12-05 01:33:28.674909442 │
│ sled_reservation_create │       8 │      0.828468017 │ 2024-12-05 01:33:28.730162961 │
│ sled_reservation_create │       9 │      0.873097224 │ 2024-12-05 01:33:28.794153708 │
│ sled_reservation_create │       9 │      0.955032207 │ 2024-12-05 01:33:28.845934386 │
│ sled_reservation_create │       9 │      0.197508201 │ 2024-12-05 01:33:28.881681675 │
│ sled_reservation_create │       9 │      0.149462298 │ 2024-12-05 01:33:28.885744511 │
│ sled_reservation_create │       9 │      0.793180628 │ 2024-12-05 01:33:28.886088411 │
│ sled_reservation_create │      10 │      0.415117964 │ 2024-12-05 01:33:28.893719099 │
│ sled_reservation_create │      10 │      0.696058103 │ 2024-12-05 01:33:28.895378347 │
│ sled_reservation_create │       9 │      0.375979786 │ 2024-12-05 01:33:28.895827480 │
│ sled_reservation_create │       9 │      0.582130243 │ 2024-12-05 01:33:28.895895919 │
│ sled_reservation_create │       9 │      0.248443142 │ 2024-12-05 01:33:28.896819194 │
│ sled_reservation_create │       9 │      0.494604555 │ 2024-12-05 01:33:28.896878275 │
│ sled_reservation_create │       8 │      0.912197561 │ 2024-12-05 01:33:28.896898433 │
│ sled_reservation_create │       9 │      0.658672723 │ 2024-12-05 01:33:28.896960491 │
│ sled_reservation_create │       9 │      0.551970483 │ 2024-12-05 01:33:28.897624816 │
│ sled_reservation_create │      10 │      0.016209634 │ 2024-12-05 01:33:28.898805461 │
│ sled_reservation_create │      10 │      0.105716568 │ 2024-12-05 01:33:29.027365323 │
│ sled_reservation_create │      10 │      0.156898598 │ 2024-12-05 01:33:29.084791389 │
│ sled_reservation_create │      10 │      0.250312168 │ 2024-12-05 01:33:29.142131741 │
│ sled_reservation_create │       6 │      0.270680676 │ 2024-12-05 01:33:29.198320779 │
│ sled_reservation_create │      10 │      0.356201247 │ 2024-12-05 01:33:29.255895834 │
│ sled_reservation_create │      10 │      0.520260954 │ 2024-12-05 01:33:29.419971070 │
│ sled_reservation_create │      10 │      0.559111319 │ 2024-12-05 01:33:29.469490091 │
│ sled_reservation_create │      10 │      0.546701788 │ 2024-12-05 01:33:29.469611345 │
│ sled_reservation_create │       9 │      0.623012858 │ 2024-12-05 01:33:29.525825667 │
│ sled_reservation_create │      10 │      0.683408988 │ 2024-12-05 01:33:29.584167826 │
│ sled_reservation_create │       7 │      0.391937344 │ 2024-12-05 01:33:29.616553141 │
│ sled_reservation_create │       6 │      0.219590647 │ 2024-12-05 01:33:33.840569035 │
│ sled_reservation_create │       6 │      0.084090369 │ 2024-12-05 01:33:33.842087748 │
│ sled_reservation_create │       7 │      0.119801922 │ 2024-12-05 01:33:33.988011575 │
│ sled_reservation_create │       6 │      0.213236734 │ 2024-12-05 01:33:34.089054712 │
│ sled_reservation_create │       7 │      0.366539562 │ 2024-12-05 01:33:34.248144833 │
│ sled_reservation_create │       6 │      0.421709534 │ 2024-12-05 01:33:34.303337077 │
│ sled_reservation_create │       6 │      0.476725124 │ 2024-12-05 01:33:34.361913178 │
│ sled_reservation_create │       8 │      0.087948518 │ 2024-12-05 01:33:34.380136265 │
│ sled_reservation_create │       8 │      0.355923108 │ 2024-12-05 01:33:34.386237295 │
│ sled_reservation_create │       7 │      0.067446466 │ 2024-12-05 01:33:34.389014498 │
│ sled_reservation_create │       6 │      0.511394557 │ 2024-12-05 01:33:34.393745987 │
│ sled_reservation_create │       7 │      0.298311704 │ 2024-12-05 01:33:34.394360943 │
│ sled_reservation_create │       9 │      0.016562406 │ 2024-12-05 01:33:34.421646209 │
│ sled_reservation_create │       9 │        0.0139722 │ 2024-12-05 01:33:34.434548804 │
│ sled_reservation_create │       7 │      0.147114351 │ 2024-12-05 01:33:34.579235725 │
│ sled_reservation_create │      10 │      0.187554888 │ 2024-12-05 01:33:34.637135706 │
│ sled_reservation_create │       6 │      0.275985452 │ 2024-12-05 01:33:34.694093409 │
│ sled_reservation_create │       8 │      0.344661774 │ 2024-12-05 01:33:34.753786115 │
│ sled_reservation_create │       8 │      0.389627457 │ 2024-12-05 01:33:34.818314321 │
│ sled_reservation_create │      10 │      0.347696569 │ 2024-12-05 01:33:34.818921340 │
│ sled_reservation_create │       8 │      0.217679284 │ 2024-12-05 01:33:34.829114603 │
│ sled_reservation_create │       7 │      0.131566108 │ 2024-12-05 01:33:34.831344890 │
│ sled_reservation_create │       9 │      0.107420426 │ 2024-12-05 01:33:34.961726822 │
│ sled_reservation_create │      10 │      0.015756441 │ 2024-12-05 01:33:35.003874869 │
│ regions_hard_delete     │       6 │      37.33837128 │ 2024-12-05 01:55:55.713677236 │
│ regions_hard_delete     │       7 │     30.054133241 │ 2024-12-05 01:56:25.793054129 │
│ regions_hard_delete     │       8 │     96.257306833 │ 2024-12-05 01:58:02.097693157 │
│ regions_hard_delete     │       6 │     47.459511859 │ 2024-12-05 01:59:40.961125584 │
│ regions_hard_delete     │       7 │      4.278932438 │ 2024-12-05 01:59:45.270298673 │
│ regions_hard_delete     │       8 │     30.225493165 │ 2024-12-05 02:00:15.512699230 │
│ soft_delete_volume      │       6 │     75.767296288 │ 2024-12-05 02:11:04.736577244 │
│ regions_hard_delete     │       6 │     19.076190374 │ 2024-12-05 02:11:24.494705891 │
│ soft_delete_volume      │       7 │     19.863352236 │ 2024-12-05 02:11:24.617146728 │
│ soft_delete_volume      │       6 │     58.314303349 │ 2024-12-05 02:11:44.276816366 │
│ soft_delete_volume      │       8 │     19.715948045 │ 2024-12-05 02:11:44.337364240 │
│ regions_hard_delete     │       7 │     21.623381073 │ 2024-12-05 02:11:46.119374265 │
│ soft_delete_volume      │       6 │     40.638575652 │ 2024-12-05 02:12:05.350153800 │
│ soft_delete_volume      │       7 │      0.059082975 │ 2024-12-05 02:12:05.413497905 │
│ soft_delete_volume      │       7 │     39.475132642 │ 2024-12-05 02:12:23.801225987 │
│ soft_delete_volume      │       9 │     39.514629572 │ 2024-12-05 02:12:23.887659446 │
│ soft_delete_volume      │       6 │      39.52895559 │ 2024-12-05 02:12:23.945818877 │
│ soft_delete_volume      │       8 │      0.198474379 │ 2024-12-05 02:12:24.003950396 │
│ soft_delete_volume      │       9 │     19.782492144 │ 2024-12-05 02:12:43.830854356 │
│ soft_delete_volume      │      10 │     19.973860043 │ 2024-12-05 02:12:43.888671839 │
│ soft_delete_volume      │       6 │     59.326150622 │ 2024-12-05 02:12:43.946974170 │
│ soft_delete_volume      │       8 │    141.428686878 │ 2024-12-05 02:14:26.863445482 │
│ soft_delete_volume      │       7 │    124.366196212 │ 2024-12-05 02:14:28.359214092 │
│ soft_delete_volume      │       6 │    134.098609609 │ 2024-12-05 02:14:57.913542354 │
│ soft_delete_volume      │      10 │    137.292073326 │ 2024-12-05 02:15:01.156675942 │
│ soft_delete_volume      │       7 │    155.440662922 │ 2024-12-05 02:15:19.436051481 │
│ soft_delete_volume      │       8 │     51.233483631 │ 2024-12-05 02:15:19.604924953 │
│ soft_delete_volume      │       9 │     52.770550003 │ 2024-12-05 02:15:19.665278398 │
│ soft_delete_volume      │       7 │     21.752585869 │ 2024-12-05 02:15:19.672147326 │
│ soft_delete_volume      │      10 │     51.822038666 │ 2024-12-05 02:16:11.493516738 │
│ soft_delete_volume      │       9 │     70.849186218 │ 2024-12-05 02:16:30.478379056 │
│ soft_delete_volume      │       8 │      70.88621631 │ 2024-12-05 02:16:30.606588907 │
│ soft_delete_volume      │      10 │      1.635190019 │ 2024-12-05 02:16:32.154911227 │
│ soft_delete_volume      │       9 │     31.321680698 │ 2024-12-05 02:17:01.971343425 │
└─────────────────────────┴─────────┴──────────────────┴───────────────────────────────┘

@smklein
Copy link
Collaborator

smklein commented Dec 5, 2024

Notably:

  • sled_reservation_create is high-contention (lots of retries), but overall, still executes quickly (observing attempt_duration). Still, reducing contention would be useful here.
  • regions_hard_delete and soft_delete_volume are high-contention, and they execute slowly. I think "attempt duration" is seconds? These transactions are taking quite a while to complete

@bnaecker
Copy link
Collaborator

bnaecker commented Dec 5, 2024

I think "attempt duration" is seconds?

It is, yes, the unit is specified in the TOML file. Also, these data are all available via omdb oxql if that's an easier way to explore them:

0x〉get database_transaction:retry_data | filter attempt > 5

database_transaction:retry_data

 attempt: 8
 name: soft_delete_volume
   2024-11-28 02:19:01.041744263: [61.27009022]
   2024-11-28 03:34:24.766695199: [21.765723489]
   2024-11-28 03:34:24.874445245: [21.776414414]
   2024-11-28 03:35:07.757368434: [43.013729313]
   2024-11-28 03:35:45.064599709: [79.969981602]
   2024-11-28 03:35:45.473305556: [80.032895955]
   2024-11-28 03:36:26.420503631: [41.467125446]
   2024-11-28 03:36:47.816524227: [62.803633553]
   2024-11-28 03:37:09.001779586: [83.860839552]
   2024-11-28 03:37:09.060166224: [83.830883651]
   2024-11-28 03:37:25.380326086: [100.134521842]
   2024-11-28 03:37:25.446580207: [100.133954]
   2024-11-28 03:37:25.505846480: [100.143783998]
   2024-12-05 02:11:44.337364240: [19.715948045]
   2024-12-05 02:12:24.003950396: [0.198474379]
   2024-12-05 02:14:26.863445482: [141.428686878]
   2024-12-05 02:15:19.604924953: [51.233483631]
   2024-12-05 02:16:30.606588907: [70.88621631]
...

@smklein
Copy link
Collaborator

smklein commented Dec 5, 2024

to make sure conversations from chats are getting recorded here:

Looking for indices under contention (https://www.cockroachlabs.com/docs/v22.1/crdb-internal#view-the-tables-indexes-with-the-most-time-under-contention) returns:

root@[fd00:1122:3344:105::3]:32221/omicron> WITH c AS (SELECT DISTINCT ON (table_id, index_id) table_id, index_id, num_contention_events AS events, cumulative_contention_time AS time FROM crdb_internal.cluster_contention_events) SELECT i.descriptor_name, i.index_name, c.events, c.time FROM crdb_internal.table_indexes AS i JOIN c ON i.descriptor_id = c.table_id AND i.index_id =
c.index_id ORDER BY c.time DESC LIMIT 10;
     descriptor_name    |                index_name                | events |      time
------------------------+------------------------------------------+--------+------------------
  dataset               | lookup_dataset_by_size_used              |     49 | 00:08:54.894216
  region                | lookup_regions_missing_ports             |     35 | 00:08:49.338858
  region                | lookup_region_by_dataset                 |     29 | 00:05:30.307997
  volume                | volume_pkey                              |     10 | 00:02:25.694972
  dataset               | dataset_pkey                             |      7 | 00:02:19.354784
  volume_resource_usage | lookup_volume_resource_usage_by_snapshot |      1 | 00:00:19.316128
  inv_collection        | inv_collection_by_time_started           |      3 | 00:00:01.516143
  inv_collection        | inv_collection_pkey                      |      1 | 00:00:00.396985
  region                | region_pkey                              |      4 | 00:00:00.075937
  ip_pool_range         | ip_pool_range_pkey                       |      1 | 00:00:00.021288
(10 rows)

@smklein
Copy link
Collaborator

smklein commented Dec 6, 2024

I'm going to try to summarize some of our observations here. Other folks on the call can feel free to respond here, or edit this message directly.

Initial Observations

  • We used SHOW TRANSACTIONS to observe that, even on a system with no outside API interactions, some transactions appeared with up to 7,000-8,000 statements at once. These transactions appeared from several different Nexuses at once, and often caused contention with each other (namely: one would get stuck at ~260 statements, and wait there until the other node completed the transaction).
  • Additionally, while this happens, even relatively simple operations like SELECT COUNT(*) FROM regions would hang for 10+ seconds, presumably due to contention. The same query on a different table of a similar size would complete within ~10ms or less, for comparison.

Questions

  • This immediately raises some questions that I'll try to answer below
    • Why are there so many statements happening within this transaction? Which transaction is it?
    • Why is this happening now?
    • Why is this work happening over and over again, instead of completing successfully?"

Further Investigation

  • The pattern of contention a couple things: the contention was coming from Nexus background tasks, because the work was periodic, and happening from multiple nodes without ongoing external API activity. But which ones? Using SHOW STATEMENTS, we saw operations from within the soft_delete_volume datastore operation appearing repeatedly.
  • Using CockroachDB commands to find long-running queries, we saw requests to Datastore::target_to_region hanging for a while. This request comes from the VCR of Crucible volumes, and is issued from soft_delete_volume_in_txn.
    • Some background: Crucible volumes contain a JSON data field called "data", which contains something called a "Volume Construction Request" (VCR). As disks are created from snapshots, which can then be used to create more snapshots and more disks, this can grow in a somewhat unbounded manner. There is a process called scrubbing which is responsible for breaking this chain of volumes, but this is currently not implemented as a part of the pantry, and therefore is not running reliably. Anyway, the important bit for now: it's possible to make volumes with a very large "VCR", especially as the lineage of "creating disks from snapshots" grows deep.

Hypotheses

Why are there so many statements happening within this transaction? Which transaction is it?

We suspect this giant transaction is happening within soft_delete_volume, and it is causing contention with other volume-based operations. @leftwo confirmed that the rack in question contains a disk with a lineage of snapshots that is ~40 volumes deep, which would result in a very large VCR, would would result in a lot of database requests within this transaction.

Why is this happening now?

soft_delete_volume is called by the "Volume Delete" saga, as one of the first steps. However, this saga itself is being run as a sub-saga of several other sagas:

  • region_replacement_finish
  • region_snapshot_replacement_step_garbage_collect
  • volume_remove_rop
  • disk_delete
  • region_snapshot_relacement_garbage_collect

Many of these sagas are being triggered by region replacement background tasks, that were recently added:

  • region_snapshot_replacement_step.rs -> SagaRegionSnapshotReplacementStep + SagaRegionSnapshotReplacementStepGarbageCollect
  • region_replacement_driver.rs -> SagaRegionReplacementFinish
  • region_snapshot_replacement_garbage_collect.rs -> SagaRegionSnapshotReplacementGarbageCollect

Why is this work happening over and over again, instead of completing successfully?

  • We suspect this is due to Read-only region clone attempting to contact expunged downstairs #7209 - namely, that the region snapshot replacement is not actually finishing correctly, because part of the region replacement attempts to contact an expunged sled. When this happens, the underlying saga fails and unwinds, which means that the "Volume Delete" subsaga -- which takes a long time to execute -- will re-run again, when the background task next triggers.

Testing

This theory is contingent on the ~40 volume deep disk taking a long time, and the region replacement work being stuck attempting to access Crucible on an expunged device.

@leftwo is going to go through the process of deleting the disks/snapshots in that long chain, which had volumes related to the unreachable crucibles. Although fixing #7209 should give us the same result, this will help identify whether or not the "very deep VCR record" is actually to blame for the extended contention.

@askfongjojo
Copy link
Author

askfongjojo commented Dec 6, 2024

After the long chain of disk/snapshot deletion, a single disk deletion takes about 30s which is an improvement (from > 70s) but is still much longer than before. So there is still something we need to track down here.

One thing I noticed is that the query used for selecting region replacement candidates takes a lot longer on rack2 compared to rack3 (the latter has >2x dataset / pools / physical disks):

  • rack2
root@[fd00:1122:3344:105::3]:32221/omicron> explain select region_snapshot.dataset_id,region_snapshot.region_id,region_snapshot.snapshot_id from
region_snapshot join dataset on region_snapshot.dataset_id = dataset.id join zpool on zpool.id = dataset.pool_id join physical_disk on physical_droot@[fd00:1122:3344:105::3]:32221/omicron> select region_snapshot.dataset_id,region_snapshot.region_id,region_snapshot.snapshot_id from region_snapshot join dataset on region_snapshot.dataset_id = dataset.id join zpool on zpool.id = dataset.pool_id join physical_disk on physical_disk.id = zpool.physical_disk_id where dataset.time_deleted is NULL and dataset.kind = 'crucible' and physical_disk.disk_policy = 'expunged';
               dataset_id              |              region_id               |             snapshot_id
---------------------------------------+--------------------------------------+---------------------------------------
  3ec0e848-39de-495e-be0e-88241e11d0fb | 2bf499e2-a4f4-4e2e-9977-875f4914a7ce | 39618f4c-0040-4a8b-9faf-0391a560d960
  09f14045-df78-447a-b7d8-217e0ca8ee09 | a649771a-179a-4dcb-8a70-02c29ea4de82 | 09d5d8f1-e39a-44dd-addc-d36ab935e592
  eb71bb55-37fb-4fc4-bdee-a5382a480271 | ff29fe1d-1b09-486a-ab17-eddcd351921c | 59bdabdd-aa9a-47b5-b263-f39ce6a420d0
(3 rows)

Time: 4.535s total (execution 4.535s / network 0.000s)
  • rack3
root@[fd00:1122:3344:116::3]:32221/omicron> select region_snapshot.dataset_id,region_snapshot.region_id,region_snapshot.snapshot_id from
region_snapshot join dataset on region_snapshot.dataset_id = dataset.id join zpool on zpool.id = dataset.pool_id join physical_disk on physical_disk.id = zpool.physical_disk_id where dataset.time_deleted is NULL and dataset.kind = 'crucible' and physical_disk.disk_policy = 'expunged';
  dataset_id | region_id | snapshot_id
-------------+-----------+--------------
(0 rows)


Time: 5ms total (execution 5ms / network 0ms)

I ran some simple select statements again each of the tables involved and dataset was the most sluggish one. The table on rack2 now has an additional 120 rows of data with kind = debug, inserted on 2024-11-26 (to be used by support bundle). To see if that might have an impact on query optimization, I checked EXPLAIN query on rack2 against a racklet and then against rack3. The rack3 one shows that it uses one of dataset's index partially:

root@[fd00:1122:3344:116::3]:32221/omicron> explain select region_snapshot.dataset_id,region_snapshot.region_id,region_snapshot.snapshot_id from
region_snapshot join dataset on region_snapshot.dataset_id = dataset.id join zpool on zpool.id = dataset.pool_id join physical_disk on physical_disk.id = zpool.physical_disk_id where dataset.time_deleted is NULL and dataset.kind = 'crucible' and physical_disk.disk_policy = 'expunged';
                                               info
---------------------------------------------------------------------------------------------------
  distribution: full
  vectorized: true

  • lookup join
  │ estimated row count: 0
  │ table: region_snapshot@lookup_region_by_dataset
  │ equality: (id) = (dataset_id)
  │
  └── • lookup join
      │ estimated row count: 0
      │ table: dataset@dataset_pkey
      │ equality: (id) = (id)
      │ equality cols are key
      │ pred: kind = 'crucible'
      │
      └── • lookup join
          │ estimated row count: 0
          │ table: dataset@lookup_dataset_by_zpool (partial index)
          │ equality: (id) = (pool_id)
          │
          └── • hash join
              │ estimated row count: 0
              │ equality: (physical_disk_id) = (id)
              │ right cols are key
              │
              ├── • scan
              │     estimated row count: 385 (100% of the table; stats collected 13 days ago)
              │     table: zpool@zpool_pkey
              │     spans: FULL SCAN
              │
              └── • filter
                  │ estimated row count: 0
                  │ filter: disk_policy = 'expunged'
                  │
                  └── • scan
                        estimated row count: 385 (100% of the table; stats collected 57 days ago)
                        table: physical_disk@physical_disk_pkey
                        spans: FULL SCAN

  index recommendations: 3
  1. type: index creation
     SQL command: CREATE INDEX ON dataset (pool_id) STORING (time_deleted, kind);
  2. type: index creation
     SQL command: CREATE INDEX ON physical_disk (disk_policy);
  3. type: index creation
     SQL command: CREATE INDEX ON zpool (physical_disk_id);

whereas the rack2 one doesn't use the lookup_dataset_by_zpool index:

root@[fd00:1122:3344:105::3]:32221/omicron> explain select region_snapshot.dataset_id,region_snapshot.region_id,region_snapshot.snapshot_id from
region_snapshot join dataset on region_snapshot.dataset_id = dataset.id join zpool on zpool.id = dataset.pool_id join physical_disk on physical_disk.id = zpool.physical_disk_id where dataset.time_deleted is NULL and dataset.kind = 'crucible' and physical_disk.disk_policy = 'expunged';
                                             info
----------------------------------------------------------------------------------------------
  distribution: full
  vectorized: true

  • hash join
  │ estimated row count: 66
  │ equality: (dataset_id) = (id)
  │ right cols are key
  │
  ├── • scan
  │     estimated row count: 513 (100% of the table; stats collected 1 day ago)
  │     table: region_snapshot@lookup_region_by_dataset
  │     spans: FULL SCAN
  │
  └── • hash join
      │ estimated row count: 28
      │ equality: (pool_id) = (id)
      │ right cols are key
      │
      ├── • filter
      │   │ estimated row count: 128
      │   │ filter: (time_deleted IS NULL) AND (kind = 'crucible')
      │   │
      │   └── • scan
      │         estimated row count: 381 (100% of the table; stats collected 25 minutes ago)
      │         table: dataset@dataset_pkey
      │         spans: FULL SCAN
      │
      └── • hash join
          │ estimated row count: 20
          │ equality: (physical_disk_id) = (id)
          │ right cols are key
          │
          ├── • scan
          │     estimated row count: 162 (100% of the table; stats collected 60 days ago)
          │     table: zpool@zpool_pkey
          │     spans: FULL SCAN
          │
          └── • filter
              │ estimated row count: 20
              │ filter: disk_policy = 'expunged'
              │
              └── • scan
                    estimated row count: 162 (100% of the table; stats collected 3 days ago)
                    table: physical_disk@physical_disk_pkey
                    spans: FULL SCAN

  index recommendations: 3
  1. type: index creation
     SQL command: CREATE INDEX ON dataset (time_deleted, kind, id, pool_id);
  2. type: index creation
     SQL command: CREATE INDEX ON physical_disk (disk_policy);
  3. type: index creation
     SQL command: CREATE INDEX ON zpool (physical_disk_id);

I wonder if implementing the first index recommendation, i.e., CREATE INDEX ON dataset (time_deleted, kind, id, pool_id) may help in our case?

@jmpesp
Copy link
Contributor

jmpesp commented Dec 6, 2024

A few notes, though I apologize as I haven't had a chance to listen to the call!

There is a process called scrubbing which is responsible for breaking this chain of volumes, but this is currently not implemented as a part of the pantry, and therefore is not running reliably.

Note that when booting a instance, propolis will perform this scrub for every Volume it activates: https://github.com/oxidecomputer/propolis/blob/220a6f367c18f2452dbc4fa9086f3fe73b961739/lib/propolis/src/block/crucible.rs#L104. It's true that we don't do this for all unattached disks though.

This theory is contingent on the ~40 volume deep disk taking a long time

I agree with the hypothesis stated here: soft_delete_volume is a giant transaction and is most likely causing contention with anything that uses the impacted tables, but I don't think I quite understand this contingency: soft_delete_volume should only be working on the contents of its argument volume, not all volumes in the rack.

We suspect this is due to #7209 ... When this happens, the underlying saga fails and unwinds, which means that the "Volume Delete" subsaga -- which takes a long time to execute -- will re-run again, when the background task next triggers.

The thing that's stuck in a loop in #7209 is the region snapshot replacement start saga, and the volume being deleted when the region snapshot replacement start saga unwinds is hard deleted, which doesn't invoke the volume delete sub saga (invoking the soft delete)

@smklein
Copy link
Collaborator

smklein commented Dec 6, 2024

@askfongjojo : I'm trying to poke at the datasets table. I think that's just one of many tables potentially modified during region replacement (we change 'size used' during allocation/deallocations), which happens to get caught in the contention.

I ran SELECT COUNT(*) FROM datasets -- I'm seeing ~381 rows, which seems like a relatively small amount of data. In the uncontended case, this takes only a couple of milliseconds to query. However, like we observed yesterday, this occasionally takes up to ~10 seconds to complete, which is aligned with the delays seen by @jgallagher when we queried the region table.

My suspicion is that this is because the table is also being locked by a long running transaction that's occasionally popping up.

As of December 6th, 10:15 AM PST, I'm still seeing multi-thousand-line-long transactions appearing in Cockroachdb via SHOW TRANSACTIONS.

Here's SHOW TRANSACTION; SHOW STATEMENTS:

root@[fd00:1122:3344:105::3]:32221/omicron> SHOW TRANSACTIONS; SHOW STATEMENTS;                                                                                                                                                               
  node_id |                txn_id                | application_name | num_stmts | num_retries | num_auto_retries                                                                                                                              
----------+--------------------------------------+------------------+-----------+-------------+-------------------                                                                                                                            
        2 | 04a80f72-cd51-4a08-9522-373211d8d332 | $ cockroach sql  |         1 |           0 |                0                                                                                                                              
        3 | 5f73f54b-480a-47c8-b86a-c456ca3e7d9d |                  |         1 |           0 |                0                                                                                                                              
        3 | 913ac073-3a1c-4084-bbb7-b9ee365ad65d |                  |      2759 |           0 |                0                                                                                                                              
(3 rows)
                                                                                                                 
node 2: SHOW CLUSTER STATEMENTS          
                                                                                  
node 3: SELECT pg_type.oid, pg_type.typarray FROM (pg_type INNER JOIN pg_namespace ON (pg_type.typnamespace = pg_namespace.oid)) WHERE ((pg_type.typname = 'sled_policy') AND (pg_namespace.nspname = 'public')) LIMIT 1

node 3: SELECT region_snapshot.dataset_id, region_snapshot.region_id, region_snapshot.snapshot_id, region_snapshot.snapshot_addr, region_snapshot.volume_references, region_snapshot.deleting FROM region_snapshot WHERE ((region_snapshot.snapshot_addr = '[fd00:1122:3344:10a::d]:19019') AND (region_snapshot.deleting = false)) 

This still appears related to region snapshotting - I believe that query comes from
async fn read_only_target_to_volume_resource_usage in db-queries/src/db/datastore/volume.rs.

This read_only_target_to_volume_resource_usage function is called from:

  • async fn volume_create_in_txn
  • async fn soft_delete_volume_in_txn
  • async fn volume_remove_rop_in_txn
  • async fn volume_replace_snapshot_in_txn
  • async fn validate_volume_has_all_resources

@smklein
Copy link
Collaborator

smklein commented Dec 6, 2024

I tried to pull up volumes that still have expensive VCRs, with:

root@[fd00:1122:3344:105::3]:32221/omicron> SELECT id, LENGTH(data) as len FROM volume WHERE time_deleted IS NULL ORDER BY LEN desc limit 10;
                   id                  |  len
---------------------------------------+--------
  40c187c6-ba33-43f0-a2e9-493b315f8729 | 18308
  b93a0e45-3e55-4a0f-8923-7d84b8552be7 | 16967
  ad2b7942-2365-40d8-b193-a796dc4e9feb | 16073
  562fae5d-37b2-4db9-beab-27e4ad8bb815 | 14732
  cee7921a-ce75-47cc-a17a-a209916ea64e | 14285
  1bc118e9-030b-49af-b5dd-8815dabe24ae | 13391
  7b7f8af1-a4af-4e5d-8b3f-410b12d609ea | 12497
  23d85920-d347-46a5-8ba9-6a777c6c248d | 12050
  0683e83e-e87a-401e-9efe-c532b8a223d0 | 11156
  85745c89-38be-4119-a168-a9c3dda584c4 | 10709

This still looks like a ~40 layer deep VCR to me. Unsure if this is the data being operated upon, but it still exists

root@[fd00:1122:3344:105::3]:32221/omicron> SELECT jsonb_pretty(data::JSON) from volume where id = '40c187c6-ba33-43f0-a2e9-493b315f8729';                                                                                                    
                                                                                                               jsonb_pretty                                                                                                                   
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------    
  {                                                                                                                                                                                                                                           
      "block_size": 512,                                                                                                                                                                                                                      
      "id": "f301dae8-9fde-4fa7-9db8-02f390f026a8",                                                                                                                                                                                           
      "read_only_parent": {                                                                                                                                                                                                                   
          "block_size": 512,                                                                                                                                                                                                                  
          "id": "d28bf2bd-3636-4fbd-b0d9-736805a54210",                                                                                                                                                                                       
          "read_only_parent": {                                                                                                                                                                                                               
              "block_size": 512,                                                                                                                                                                                                              
              "id": "83fc3d1f-6855-43a5-9e70-5aebffece981",                                                                                                                                                                                   
              "read_only_parent": {                                                                                                                                                                                                           
                  "block_size": 512,                                                                                                                                                                                                          
                  "id": "ac236c74-1e22-4e09-ad2f-dfb85af32c9e",                                                                                                                                                                               
                  "read_only_parent": {                                                                                                                                                                                                       
                      "block_size": 512,                                                                                                                                                                                                      
                      "id": "52107247-3062-4fbc-80bd-67c64877bb97",                                                                                                                                                                           
                      "read_only_parent": {                                                                                                                                                                                                   
                          "block_size": 512,                                                                                                                                                                                                  
                          "id": "61a58325-c728-44e1-9570-4a5e2eacf0f3",                                                                                                                                                                       
                          "read_only_parent": {                                                                                                                                                                                               
                              "block_size": 512,                                                                                                                                                                                              
                              "id": "96064ff6-3c86-45d4-b3ca-54f9d6a7b1a5",                                                                                                                                                                   
                              "read_only_parent": {                                                                                                                                                                                           
                                  "block_size": 512,                                                                                                                                                                                          
                                  "id": "181d4d82-9c0d-4944-94fa-a86e7e942af2",                                                                                                                                                               
                                  "read_only_parent": {                                                                                                                                                                                       
                                      "block_size": 512,                                                                                                                                                                                      
                                      "id": "e18994e7-b7c8-4a0d-9a3e-84dfe8b0823c",
                                      "read_only_parent": { 
                                          "block_size": 512,
                                          "id": "b8762486-38c5-46af-bd92-90bde96a5ecf",
                                          "read_only_parent": {
                                              "block_size": 512,
                                              "id": "13ddb467-909f-4f9c-b63c-2d7d44c9b3f1",
                                              "read_only_parent": {
                                                  "block_size": 512,
                                                  "id": "d6e634fa-8ded-4142-9f28-b2602be5c453",
                                                  "read_only_parent": {
                                                      "block_size": 512,
                                                      "id": "9b21e420-77c3-43f0-801d-e203b04942e0",
                                                      "read_only_parent": {
                                                          "block_size": 512,
                                                          "id": "e37f3713-7137-4fc4-b464-27ebe5e9fade",
                                                          "read_only_parent": {
                                                              "block_size": 512,
                                                              "id": "6d9ef958-41d3-47bc-a2c0-9f286adfe291",
                                                              "read_only_parent": {
                                                                  "block_size": 512,
                                                                  "id": "e2d2fbd6-44d7-472a-b587-0da56907682c",
                                                                  "read_only_parent": {
                                                                      "block_size": 512,
                                                                      "id": "20b4d6a7-c5c2-4326-93c6-f2ac3730fc14",
                   
(etc)

@jmpesp
Copy link
Contributor

jmpesp commented Dec 9, 2024

Looking into this, we discovered that the testing feature was being enabled for nexus release builds, which causes validate_volume_invariants to run:

/// Tests each Volume to see if invariants hold
///
/// If an invariant is violated, this function returns a `CheckViolation`
/// with the text of what invariant was violated.
pub(crate) async fn validate_volume_invariants(

This scans every volume in the database and performs invariant checks on each one. This function (guarded by the feature testing) is called at the end of many volume related interactive transaction functions, and is the reason that these transactions have so many associated statements.

iliana added a commit that referenced this issue Dec 10, 2024
#5799 modified the `cargo build` command line omicron-package runs.
Previously it built up a list of packages to be built using the `-p`
flag; that PR changed it to use `--bin`. The goal was to build only the
binaries that are necessary for shipping; this avoids building
sled-agent-sim during releng, for instance.

We did not realize it at the time, but this invited the specter of
rust-lang/cargo#8157 to wreak havoc; namely:

- Without `--package`, Cargo uses the `default-members` key of the
workspace Cargo.toml to determine which packages to build. `--bin` does
not cause the same thing to happen; saying `--bin` does _not_ imply
`--package [the package that the bin belongs to]`.
- `omicron-dev` belongs to `default-members` and has a normal dependency
on `nexus-test-utils`, which enables the `"testing"` feature of
`nexus-db-queries`.

#7208 is a known result
of this problem, but there might be more.

Fortunately the solution seems fairly easy, without reverting the
relevant changes from #5799: use _both_ `--package` and `--bin`. With
this change, the `"testing"` feature is no longer shown in the `cargo
build --unit-graph` and `nm target/release/nexus | demangle | grep
validate_volume_invar` no longer shows any matching testing-only
symbols.
@askfongjojo
Copy link
Author

Confirmed that the CRDB error was no longer seen after #7212 and the slowness with disk creation/deletion (originally reported in #7188) is no longer happening after #7218.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants