Skip to content

DataStore::physical_disk_update_policy() doesn't update time_modified #7502

@jgallagher

Description

@jgallagher

While investigating #7501, we found a disk that claimed to be expunged 11 months ago:

root@[fd00:1122:3344:105::3]:32221/omicron> select * from physical_disk where serial = 'A084A5EE';
                   id                  |         time_created          |         time_modified         | time_deleted | rcgen | vendor |  serial  |      model      | variant |               sled_id                | disk_policy |   disk_state
---------------------------------------+-------------------------------+-------------------------------+--------------+-------+--------+----------+-----------------+---------+--------------------------------------+-------------+-----------------
  0bffef3c-56b1-4b01-b897-161bbf766bea | 2023-08-30 18:57:23.655377+00 | 2024-03-27 21:18:20.906665+00 | NULL         |     1 | 1b96   | A084A5EE | WUS4C6432DSP3X3 | u2      | 0c7011f7-a4bf-4daf-90cc-1c2410103300 | expunged    | decommissioned
(1 row)

but subsequent digging found that it was actually expunged a few days ago:

2025-02-03 07:04:17.560Z DEBG 20b100d0-84c3-4119-aa9b-0c632b0b6a3a/11421 (dropshot_internal) on oxz_nexus_20b100d0-84c3-4119-aa9b-0c632b0b6a3a: authorize result
    action = Modify
    actor = Some(Actor::UserBuiltin { user_builtin_id: 001de000-05e4-4000-8000-000000000002, .. })
    actor_id = 001de000-05e4-4000-8000-000000000002
    authenticated = true
    local_addr = [fd00:1122:3344:104::3]:12221
    method = POST
    remote_addr = [fd00:1122:3344:108::2]:34294
    req_id = c2350d2d-86b1-4232-b3f4-b5a139d2c4f9
    resource = PhysicalDisk { parent: Fleet, key: 0bffef3c-56b1-4b01-b897-161bbf766bea (physical_disk), lookup_type: ById(0bffef3c-56b1-4b01-b897-161bbf766bea) }
    result = Ok(())
    uri = /physical-disk/expunge
2025-02-03 07:04:17.612Z INFO 20b100d0-84c3-4119-aa9b-0c632b0b6a3a/11421 (dropshot_internal) on oxz_nexus_20b100d0-84c3-4119-aa9b-0c632b0b6a3a: request completed
    file = /home/build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dropshot-0.15.1/src/server.rs:867
    latency_us = 73067
    local_addr = [fd00:1122:3344:104::3]:12221
    method = POST
    remote_addr = [fd00:1122:3344:108::2]:34294
    req_id = c2350d2d-86b1-4232-b3f4-b5a139d2c4f9
    response_code = 204
    uri = /physical-disk/expunge

physical_disk_update_policy() only updates disk_policy; it should also update time_modified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions