Commit 5743c72
authored
Index
We originally planned to retain 30 days of metrics for this source in
order to use it in the console. However, that makes it difficult to
index, because it can be very large (hundreds of rows).
The lack of index is deemed more serious than the retention policy
currently, since we aren't querying this from the console (and have no
active plans to do so), and since the lack of index means users that
query this relation (even if they only care about the latest values)
incur a full scan of a potentially huge persist shard.
In one customer environment, a simple `SELECT count(*) FROM
mz_internal.mz_source_statistics` was observed to cause
`mz_introspection` to lose interactivity for >30s reproducibly.
### Motivation
* This PR fixes a previously unreported bug.
Querying `mz_internal.mz_source_statistics` causes the
`mz_introspection` cluster to lose interactivity in deployments with a
large (but realistic) number of sources.
### Checklist
- [x] This PR has adequate test coverage / QA involvement has been duly
considered.
- [x] This PR has an associated up-to-date [design
doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md),
is a design doc
([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)),
or is sufficiently small to not require a design.
<!-- Reference the design in the description. -->
- [x] If this PR evolves [an existing `$T ⇔ Proto$T`
mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md)
(possibly in a backwards-incompatible way), then it is tagged with a
`T-proto` label.
- [x] If this PR will require changes to cloud orchestration, there is a
companion cloud PR to account for those changes that is tagged with the
release-blocker label
([example](https://github.com/MaterializeInc/cloud/pull/5021)).
<!-- Ask in #team-cloud on Slack if you need help preparing the cloud
PR. -->
- [x] This PR includes the following [user-facing behavior
changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note):
- Fix a bug where querying `mz_internal.mz_source_statistics` could
cause system instability in some cases.MZ_SOURCE_STATISTICS and decrease its retention (MaterializeInc#19839)1 parent 1a7460a commit 5743c72
File tree
4 files changed
+27
-5
lines changed- src/adapter/src/catalog
- test
- sqllogictest
- testdrive
4 files changed
+27
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1986 | 1986 | | |
1987 | 1987 | | |
1988 | 1988 | | |
1989 | | - | |
| 1989 | + | |
1990 | 1990 | | |
1991 | 1991 | | |
1992 | 1992 | | |
| |||
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
2002 | | - | |
| 2002 | + | |
2003 | 2003 | | |
2004 | 2004 | | |
2005 | 2005 | | |
| |||
3708 | 3708 | | |
3709 | 3709 | | |
3710 | 3710 | | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
3711 | 3729 | | |
3712 | 3730 | | |
3713 | 3731 | | |
| |||
4077 | 4095 | | |
4078 | 4096 | | |
4079 | 4097 | | |
| 4098 | + | |
| 4099 | + | |
4080 | 4100 | | |
4081 | 4101 | | |
4082 | 4102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
332 | 334 | | |
333 | 335 | | |
0 commit comments