Commit e3994e0
authored
cockroach-admin: Allow partial success parsing
The `cockroach-admin` server runs `cockroach node status --all` both to
find its local node ID and to service the `/node/status` endpoint. We
have no production callers of the latter, but inventory relies on the
former. We've previously seen that we can't get reasonable status from
decommissioned nodes (in particular, we rely on socket addresses being
present, and decommissioned nodes have `NULL` socket addresses) and so
already skip rows from decommissioned nodes. However, in #10068 we saw
similar invalid rows from not-yet-decommissioned nodes, which broke
inventory collection.
This change relaxes our parsing: instead of bailing on any failure
parsing a single row, we accumulate separate vecs of successfully parsed
rows and failures parsing rows and return both. `cockroach-admin` logs
the errors but otherwise ignores them. I don't love this but I _think_
it should be okay; a failure mode here is "we fail to parse any rows at
all", but in practice the effect of having an empty vec of
successfully-parsed rows is the same as failing the call entirely: we
won't be able to find our local node ID or report any useful node
status.
I think we'd be better off jettisoning this parsing entirely, if there's
a way we could get at all this information from another source (either
the prometheus endpoint we're already scraping, or maaaaaybe poking at
files on disk, e.g., if there's a file that contains the local node
ID?). But either of those would be larger changes, and this should
unblock testing that bumped into the parsing issue.
Closes #10068.cockroach node status --all rows (#10072)1 parent f828af7 commit e3994e0
7 files changed
Lines changed: 273 additions & 29 deletions
File tree
- cockroach-admin
- src
- types/versions
- src
- impls
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| 164 | + | |
162 | 165 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
169 | 190 | | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
| 195 | + | |
174 | 196 | | |
175 | | - | |
| 197 | + | |
176 | 198 | | |
177 | 199 | | |
178 | 200 | | |
| |||
423 | 445 | | |
424 | 446 | | |
425 | 447 | | |
426 | | - | |
| 448 | + | |
| 449 | + | |
427 | 450 | | |
428 | 451 | | |
429 | 452 | | |
| |||
463 | 486 | | |
464 | 487 | | |
465 | 488 | | |
466 | | - | |
| 489 | + | |
467 | 490 | | |
468 | 491 | | |
469 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
0 commit comments