Commit a2c8829
Fix extractors being deleted when an input is started or stopped (
* Fix extractors being deleted when an input is started or stopped (#26198)
* Fix extractors being deleted when an input is started or stopped
The PersistedImpl -> AutoValue migration of InputImpl (#24057) dropped
the embedded extractors array from the entity model: the builder ignores
unknown properties, so loading an input discards its extractors, and
saving uses replaceOne, which then persists the loss by replacing the
whole document.
Starting or stopping an input persists the desired state on the input
document since #25338, so every start/stop deleted all extractors of the
input. Updating an input through the REST API had the same effect via
the getFields() merge in InputsResource, which also omitted extractors.
Fix this by modeling the embedded extractor documents on InputImpl (like
the embedded static fields) so they survive full document round-trips,
and by carrying them through getFields() and buildFromMap(). Also turn
persistDesiredState() into a targeted update of the desired_state field
so state changes no longer rewrite the whole document.
Fixes #26009
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* CL
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit dbc747f)
* Remove backported extractor regression tests from 7.1 branch
---------
Co-authored-by: Patrick Mann <patrickmann@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>7.1) (#26203)1 parent 157ade0 commit a2c8829
4 files changed
Lines changed: 35 additions & 2 deletions
File tree
- changelog/unreleased
- graylog2-server/src
- main/java/org/graylog2/inputs
- test/java/org/graylog2/inputs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
| |||
226 | 238 | | |
227 | 239 | | |
228 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
229 | 246 | | |
230 | 247 | | |
231 | 248 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
299 | 304 | | |
300 | 305 | | |
301 | 306 | | |
| |||
749 | 754 | | |
750 | 755 | | |
751 | 756 | | |
752 | | - | |
753 | | - | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
754 | 763 | | |
755 | 764 | | |
756 | 765 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
| 470 | + | |
469 | 471 | | |
470 | 472 | | |
471 | 473 | | |
| |||
0 commit comments