Skip to content

changefeedccl: feed excluding column families leaks mem mon allocs for ignored events #154776

@asg0451

Description

@asg0451

Changefeeds watching a subset of a table's column families will leak the Alloc for events coming from unwatched families due to a missing Release() call in an early return here and here. This has likely existed since column family support was introduced.

Found while investigating this support issue.

Minimal repro:

create table cftest (
  id int primary key,
  pstr string,
  data string,
  FAMILY prim (id, pstr),
  FAMILY df (data)
);

insert into cftest (id, pstr, data)
select
  g,
  'hello-' || g::string,
  REPEAT('SQL', 5000)
from generate_series(1, 10000) as g;

set cluster setting changefeed.memory.per_changefeed_limit = '1MiB'; -- set this low to make it easier to hit the limit

CREATE CHANGEFEED FOR TABLE cftest family prim INTO 'null:' with initial_scan='no', diff; 
-- diff is not required to break it, but also makes it easier to hit the limt, as prev values' allocs are also leaked

update cftest set data = REPEAT('SQL2', 5000) where true;

-> observe sql.mem.bulk.current maxing at 1MiB (configured max), and changefeed.max_behind_nanos to start rising

Image

Jira issue: CRDB-55112

Metadata

Metadata

Assignees

Labels

A-cdcChange Data CaptureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsT-cdcbranch-masterFailures and bugs on the master branch.branch-release-24.1Used to mark GA and release blockers, technical advisories, and bugs for 24.1branch-release-24.3Used to mark GA and release blockers, technical advisories, and bugs for 24.3branch-release-25.1branch-release-25.2branch-release-25.3Used to mark GA and release blockers and technical advisories for 25.3branch-release-25.4Used to mark GA and release blockers and technical advisories for 25.4

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions