Skip to content

Commit

Permalink
fix(enriching): prevent panic when attaching inputs to sinks with nam…
Browse files Browse the repository at this point in the history
…e of a table (#22528)

* fix(enriching): prevent panic when attaching inputs to sinks with name of a table

If an enrichment table has the same name as one of components, even when that table is not used as a
sink, `topology/running` panics when configuring inputs, because it is not checking the updated
`inputs` map, but the `tasks` map when looking up enrichment tables that act as sinks.

Closes: #22514

* Add changelog entry

* Add 0.45.0 known issue note

* Update website/cue/reference/releases/0.45.0.cue

Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>

---------

Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
  • Loading branch information
esensar and pront authored Feb 26, 2025
1 parent fe700dc commit 6caf5f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.d/22528_enrichment_panic.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Prevent panic when an enrichment table has the same name as one of components.

authors: esensar
2 changes: 1 addition & 1 deletion src/topology/running.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ impl RunningTopology {
let added_changed_tables: Vec<&ComponentKey> = diff
.enrichment_tables
.changed_and_added()
.filter(|k| new_pieces.tasks.contains_key(k))
.filter(|k| new_pieces.inputs.contains_key(k))
.collect();
for key in added_changed_tables {
debug!(component = %key, "Connecting inputs for enrichment table sink.");
Expand Down
6 changes: 6 additions & 0 deletions website/cue/reference/releases/0.45.0.cue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ releases: "0.45.0": {
- The `tag_cardinality_limit` transform now supports customizing limits for metrics that are based on the metric name and namespace.
"""

known_issues: [
"""
To prevent a crash at startup, avoid name clashes between enrichment table names and other components like sources, transforms, and sinks in the configuration. To resolve this, you can rename the enrichment table to a unique name that isn't already used by any other component.
""",
]

changelog: [
{
type: "feat"
Expand Down

0 comments on commit 6caf5f8

Please sign in to comment.