-
Notifications
You must be signed in to change notification settings - Fork 499
catalog: unified object arrangement across clusters and replicas #36214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8ba2480
487915c
129085d
05915ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -214,6 +214,20 @@ pub const CONSOLE_OIDC_SCOPES: Config<&'static str> = Config::new( | |||||
| "Space-separated OIDC scopes requested by the web console.", | ||||||
| ); | ||||||
|
|
||||||
| /// Interval at which to collect per-object arrangement size snapshots for the history table. | ||||||
| pub const ARRANGEMENT_SIZE_COLLECTION_INTERVAL: Config<Duration> = Config::new( | ||||||
| "arrangement_size_collection_interval", | ||||||
| Duration::from_secs(60 * 60), | ||||||
| "Interval at which to collect and snapshot per-object arrangement sizes.", | ||||||
| ); | ||||||
|
|
||||||
| /// How long to retain per-object arrangement size history. | ||||||
| pub const ARRANGEMENT_SIZE_RETENTION_PERIOD: Config<Duration> = Config::new( | ||||||
| "arrangement_size_retention_period", | ||||||
| Duration::from_secs(7 * 24 * 60 * 60), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| "How long to retain per-object arrangement size history.", | ||||||
| ); | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a sentinel value ( |
||||||
| /// Adds the full set of all adapter `Config`s. | ||||||
| pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet { | ||||||
| configs | ||||||
|
|
@@ -245,4 +259,6 @@ pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet { | |||||
| .add(&USER_ID_POOL_BATCH_SIZE) | ||||||
| .add(&CONSOLE_OIDC_CLIENT_ID) | ||||||
| .add(&CONSOLE_OIDC_SCOPES) | ||||||
| .add(&ARRANGEMENT_SIZE_COLLECTION_INTERVAL) | ||||||
| .add(&ARRANGEMENT_SIZE_RETENTION_PERIOD) | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -566,4 +566,39 @@ const SUBSCRIBES: &[SubscribeSpec] = &[ | |
| GROUP BY export_id, lir_id | ||
| )", | ||
| }, | ||
| // Per-object arrangement sizes, one row per `(object_id, replica)`. | ||
| // | ||
| // `mz_arrangement_heap_size_raw` and `mz_arrangement_batcher_size_raw` are | ||
| // differential logs where each `+1` row represents one byte of heap delta; | ||
| // after consolidation, `COUNT(*)` is the current arrangement size in bytes. | ||
| // | ||
| // Objects smaller than 10 MiB report exact bytes; larger ones are rounded | ||
| // to the nearest 10 MiB to suppress byte-level churn in the collection. | ||
|
Comment on lines
+575
to
+576
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will have a lot of noise independently of the 10MiB gate. Running the subscribe on an otherwise empty cluster shows an update for at least one export every second. You could filter temporary exports |
||
| // | ||
| // `mz_dataflow_addresses.address[1]` is the root of each operator's address | ||
| // tree, which equals the owning `dataflow_id` — so we can go addresses → | ||
| // operator → dataflow without joining `mz_dataflow_operator_dataflows`. | ||
| SubscribeSpec { | ||
| introspection_type: IntrospectionType::ComputeObjectArrangementSizes, | ||
| sql: "SUBSCRIBE ( | ||
| SELECT | ||
| ce.export_id AS object_id, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note this bakes in an assumption that's not guaranteed to be true in the future, which is that one dataflow has one export. If it'd change, we'd double-count. Just calling it out. Once it happens, we'd need to re-think what the granularity for this information is instead. |
||
| CASE | ||
| WHEN COUNT(*) < 10485760 THEN COUNT(*)::int8 | ||
| ELSE ((COUNT(*) + 5242880) / 10485760 * 10485760)::int8 | ||
| END AS size | ||
| FROM mz_introspection.mz_compute_exports AS ce | ||
| JOIN ( | ||
| SELECT addrs.address[1] AS dataflow_id, addrs.id AS operator_id | ||
| FROM mz_introspection.mz_dataflow_addresses addrs | ||
| ) AS od ON od.dataflow_id = ce.dataflow_id | ||
| JOIN ( | ||
| SELECT operator_id FROM mz_introspection.mz_arrangement_heap_size_raw | ||
| UNION ALL | ||
| SELECT operator_id FROM mz_introspection.mz_arrangement_batcher_size_raw | ||
|
Comment on lines
+596
to
+598
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit unfortunate you'll need to go through the raw collections, but right now this seems to be the best approach. The views we define on top of the raw collections do more than what you need here, and certainly will be more expensive to maintain. |
||
| ) AS rs ON rs.operator_id = od.operator_id | ||
| GROUP BY ce.export_id | ||
| OPTIONS (AGGREGATE INPUT GROUP SIZE = 1000) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Count don't need the aggregate input group size annotation (it's only for hierarchical reductions, not for simple ones.) |
||
| )", | ||
| }, | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.