Skip to content

Ensure workspace instances have a stoppingTime when they are stopped #12955

@easyCZ

Description

@easyCZ

In order to improve data quality of workspace instances, we need to ensure that all instances which are stopped (phasePersisted = 'stopped') also have a stoppingTime.

This is required to ensure that usage & billing remains accurate.

One can identify these cases in the DB with the following SQL query:

SELECT *
FROM d_b_workspace_instance
WHERE stoppingTime = '' AND phasePersisted = 'stopped'

There are 2 parts to this:

  1. Ideally we want to fix the root-cause of this - identify where and under what conditions we fail to set the stoppingTime

  2. Ensure that if it does happen, we automatically correct this scenario.

  3. The WorkspaceInstance record is created and tracked by ws-manager-bridge when it receives updates from ws-manager (through bridge).

Note: There's currently a missing index (PR) on stoppingTime which makes it very slow to list all instances with stopping time not set.

Edit: Fixed type from stoppedTime to stoppingTime - these are different fields, but would make sense to keep them consistent anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions