Class MaintenanceOperationEntity
One planned maintenance window across a set of servers.
public class MaintenanceOperationEntity
- Inheritance
-
MaintenanceOperationEntity
- Inherited Members
Remarks
This row is the plan, and the plan is the whole point. Taking a shard down is a sequence — lock so nobody new joins, wait for players to drain, then stop — and done by hand across a dozen servers somebody misses one. Writing it down means the operator can close their laptop: the drain does not live in a browser tab.
It carries no steps to execute. Everything that acts on a server is written the
moment the operation starts, into the servers' own locked and
shutdown_at_utc columns, which each server reads back on its next pulse and
adopts. The deadline is absolute, so the drain counts down inside every server process
whether or not anything else is running — no panel, no scheduler, no tab. What is left
here afterwards is a record and an observation, which is why Status is
derived from the target rows rather than advanced by anybody.
No foreign key from StartedBy to accounts, for the audit log's reason: who took a shard down must outlive the account that did it.
Properties
CancelReason
Why it was cancelled.
public string CancelReason { get; set; }
Property Value
CancelledBy
The operator account that cancelled it.
public string CancelledBy { get; set; }
Property Value
CancelledUtc
When it was cancelled.
public DateTime? CancelledUtc { get; set; }
Property Value
CompletedUtc
When every target reached a terminal state.
public DateTime? CompletedUtc { get; set; }
Property Value
DeadlineUtc
The absolute instant every target is due to stop.
public DateTime DeadlineUtc { get; set; }
Property Value
Remarks
Stored on the operation as well as on each target so a cancelled or half-written window still says what it was going to do, and so the drain's end can be read without loading every target row.
DrainSeconds
How long players were given, in seconds.
public int DrainSeconds { get; set; }
Property Value
ID
Surrogate key.
public long ID { get; set; }
Property Value
Name
What the operator called this window.
public string Name { get; set; }
Property Value
Outcome
What happened in the end, in words.
public string Outcome { get; set; }
Property Value
Reason
Why. Mandatory at the API, and recorded in the audit log as well.
public string Reason { get; set; }
Property Value
RequestKey
The writer's once-per-request identity: a retry after a lost reply finds the row its first attempt wrote instead of writing a second one. Null for rows written without one.
public Guid? RequestKey { get; set; }
Property Value
- Guid?
Remarks
Here a second write would not even be written: the retry found its own window's targets live and refused itself with "already in maintenance window N", so the operator was told a window they had just started had failed.
StartedBy
The operator account that planned it. Copied, with no foreign key.
public string StartedBy { get; set; }
Property Value
StartedUtc
When the plan was written, which is when the servers were locked.
public DateTime StartedUtc { get; set; }
Property Value
Status
Where the window has got to. Derived from the targets; see the remarks.
public MaintenanceStatus Status { get; set; }
Property Value
Targets
The servers in this window.
public ICollection<MaintenanceTargetEntity> Targets { get; set; }