Commit 1fe5228
committed
fix: handle incompatible schemas in histogram aggregation
When downsampling histograms, if the schema type changes between
custom bucket histograms (schema < 0) and exponential bucket histograms
(schema >= 0), the Add operation would fail because these histogram
types cannot be added together.
This fix checks for incompatible schemas before attempting to add
histograms. When incompatible schemas are detected, the aggregation
is reset to the new histogram, similar to how counter resets are handled.
Fixes panic when mixing custom bucket and exponential bucket histograms
during downsampling.
Signed-off-by: Br1an67 <932039080@qq.com>1 parent 7bbca4d commit 1fe5228
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
| |||
391 | 398 | | |
392 | 399 | | |
393 | 400 | | |
394 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
395 | 410 | | |
396 | 411 | | |
397 | 412 | | |
| |||
0 commit comments