Reboots, fencing and partitions, maintenance from Gandalf, known conditions; T2/T3/T4/DIMM replays
CI / Lint (flake8, house style) (pull_request) Successful in 54s
CI / Test (pytest) (pull_request) Successful in 55s
CI / Security (bandit, pip-audit) (pull_request) Successful in 56s
CI / Integration (MariaDB) (pull_request) Successful in 2m2s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m30s
CI / Deploy (pull_request) Skipped
CI / Lint (flake8, house style) (pull_request) Successful in 54s
CI / Test (pytest) (pull_request) Successful in 55s
CI / Security (bandit, pip-audit) (pull_request) Successful in 56s
CI / Integration (MariaDB) (pull_request) Successful in 2m2s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m30s
CI / Deploy (pull_request) Skipped
- checks/reboots.py (thor#4): boot-time changes classified as planned (logind line), unexpected, or unknown (journal went quiet first); several together are one event. - checks/cluster.py: HA fence lines, watchdog self-fences, corosync quorum loss: one host is 'lost its cluster link and was fenced' (P2), two or more a cluster partition (P1). - checks/maintenance.py: Gandalf suppressions (with ended ones) as a cause that never opens a ticket; everything under it goes on the timeline. - Engine: higher causes first, lower causes they explain become symptoms; a higher cause found later absorbs pending ones and comments 'Root cause' on opened ones; host-scoped causes never explain another host's cause; incidents stay active while an attached host is still down; silent state changes are saved; notes join timeline-only incidents. - Known conditions (migration 3, seeded): compute-storage-02 reboots and Ceph noout -> 693930698, the old UPS battery. A match sends a note to that ticket instead of a new one. - Replays: T2 0 tickets; T3 one P2 (fenced, cleared when the host is back); T4 one P1 partition (storage-01's later fence and all reboots fold in); DIMM one note on 693930698. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
983ba27386
commit
e70dee0ad8
21 files changed
+954
-31920
No files matched your search
+26
-2
@@ -78,6 +78,27 @@ class ReplayProxmox(_Blindable):
|
||||
return []
|
||||
|
||||
|
||||
class ReplayGandalf(_Blindable):
|
||||
"""Suppressions as Gandalf would have shown them at the replay's current time."""
|
||||
|
||||
def __init__(self, fixture, clock):
|
||||
super().__init__('gandalf', fixture, clock)
|
||||
self.records = fixture.get('suppressions', [])
|
||||
|
||||
def suppressions(self, hours=24, include_ended=True):
|
||||
from thor.checks.maintenance import parse_time
|
||||
self._guard()
|
||||
now, out = self.clock.t, []
|
||||
for r in self.records:
|
||||
start, end = parse_time(r['started_at']), parse_time(r.get('ended_at'))
|
||||
if start > now or start < now - hours * 3600 - 86400:
|
||||
continue
|
||||
if end is not None and end > now:
|
||||
r = dict(r, ended_at=None, state='active')
|
||||
out.append(r)
|
||||
return out
|
||||
|
||||
|
||||
class Replay:
|
||||
def __init__(self, name: str, settings: Settings = None):
|
||||
self.fixture = load(name)
|
||||
@@ -86,14 +107,17 @@ class Replay:
|
||||
self.settings = settings or Settings()
|
||||
self.prometheus = ReplayPrometheus(self.fixture, self.clock)
|
||||
sources = {'prometheus': self.prometheus, 'loki': ReplayLoki(self.fixture, self.clock),
|
||||
'proxmox': ReplayProxmox(self.fixture, self.clock)}
|
||||
'proxmox': ReplayProxmox(self.fixture, self.clock),
|
||||
'gandalf': ReplayGandalf(self.fixture, self.clock)}
|
||||
self.monitor = Monitor(self.settings, self.store, sources, checks=build_checks(), clock=self.clock)
|
||||
self.results = []
|
||||
|
||||
def run(self, until: float = None):
|
||||
until = until or self.fixture['end']
|
||||
down = self.fixture.get('thor_down', [])
|
||||
while self.clock.t <= until:
|
||||
self.results.append(self.monitor.cycle())
|
||||
if not any(s <= self.clock.t <= e for s, e in down): # Thor was dark too: no cycle
|
||||
self.results.append(self.monitor.cycle())
|
||||
self.clock.advance(self.settings.cycle_seconds)
|
||||
return self
|
||||
|
||||
|
||||
Reference in new issue
Block a user