Commit 4a35b7e
authored
An assortment of Pbench Ops fixes and fun (distributed-system-analysis#3612)
* An assortment of Pbench Ops fixes and fun
This fixes several issues observed during ops review:
1. The `/api/v1/endpoints` API fails if the server is shut down
2. `tar` unpack errors can result in enormous `stderr` output, which is
captured in the `Audit` log; truncate it to 5Mb
3. Change the `pbench-audit` utility to use `dateutil.parser` instead of
`click.DateTime()` so we can include fractional seconds and timezone.
During the time when we broke PostgreSQL, we failed to create metadata for a
number of datasets that were allowed to upload. (Whether we should allow this
vs failing the upload is a separate issue.) We have want to repair the
excessively large `Audit` attributes records. So I took a stab at some
wondrous and magical SQL queries and hackery to begin a new `pbench-repair`
utility. Right now, it repairs long audit attributes "intelligently" by
trimming individual JSON key values; and it add metadata to datasets which
lack critical values. Currently, this includes `server.tarball-path` (which
we need to enable TOC and visualization), `dataset.metalog` (capturing the
tarball `metadata.log` file), and `server.benchmark` for visualization.
There are other `server` namespace values (including expiration time) that
could be repaired: I decided not to worry about that as we're not doing
expiration anyway. (Though I might add it over the weekend, since it shouldn't
be hard.) And there are probably other things we might want to repair in the
future using this framework.
I tested this in a `runlocal` container, using `psql` to "break" datasets and
repair them. I hacked the local `repair.py` with a low "max error" limit to
force truncation of audit attributes:
```
pbench-repair --detail --errors --verify --progress 10
(22:52:08) Repairing audit
|| 60:FAILURE upload fio_rw_2018.02.01T22.40.57 [message] truncated (107) to 105
|| 116:SUCCESS apikey None [key] truncated (197) to 105
22 audit records had attributes too long
2 records were fixed
(22:52:08) Repairing metadata
|| fio_rw_2018.02.01T22.40.57 has no server.tarball-path: setting /srv/pbench/archive/fs-version-001/dhcp31-45.perf.lab.eng.bos.redhat.com/08516cc7448035be2cc502f0517783fa/fio_rw_2018.02.01T22.40.57.tar.xz
|| fio_rw_2018.02.01T22.40.57 has no metalog: setting from metadata.log
|| fio_rw_2018.02.01T22.40.57 has no server.benchmark: setting 'fio'
|| pbench-user-benchmark_example-vmstat_2018.10.24T14.38.18 has no server.tarball-path: setting /srv/pbench/archive/fs-version-001/ansible-host/45f0e2af41977b89e07bae4303dc9972/pbench-user-benchmark_example-vmstat_2018.10.24T14.38.18.tar.xz
|| pbench-user-benchmark_example-vmstat_2018.10.24T14.38.18 has no metalog: setting from metadata.log
|| pbench-user-benchmark_example-vmstat_2018.10.24T14.38.18 has no server.benchmark: setting 'pbench-user-benchmark'
2 server.tarball-path repairs, 0 failures
2 dataset.metalog repairs, 0 failures
2 server.benchmark repairs
```1 parent bf2792f commit 4a35b7e
File tree
13 files changed
+473
-66
lines changed- lib/pbench
- cli/server
- server
- api/resources
- database/models
- test/unit/server
- server
13 files changed
+473
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
14 | 35 | | |
15 | 36 | | |
16 | 37 | | |
| |||
63 | 84 | | |
64 | 85 | | |
65 | 86 | | |
66 | | - | |
| 87 | + | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
70 | 91 | | |
71 | 92 | | |
72 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
73 | 97 | | |
74 | 98 | | |
75 | 99 | | |
76 | 100 | | |
77 | 101 | | |
78 | 102 | | |
79 | 103 | | |
80 | | - | |
| 104 | + | |
81 | 105 | | |
82 | | - | |
| 106 | + | |
83 | 107 | | |
84 | 108 | | |
85 | 109 | | |
86 | 110 | | |
87 | 111 | | |
88 | | - | |
| 112 | + | |
89 | 113 | | |
90 | 114 | | |
91 | 115 | | |
| |||
138 | 162 | | |
139 | 163 | | |
140 | 164 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | | - | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
150 | | - | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
0 commit comments