[Bug]: Hierarchial CAgg Chain Broken from 1 day to 1 month

Author: arfathyahiyaCreated Mar 2, 2026Updated Sep 30, 2026
LabelsbugContinuous Aggregatev2.23.1

What type of bug is this?

Other

What subsystems and features are affected?

Continuous aggregate

What happened?

I have Hierarchical CAgg in the following order

cagg_30min -> cagg_1h -> cagg_6h - > cagg_12h -> cagg_1d -> cagg_1m -> cagg_1y

All of them have materialized_only set to false so we can get real-time data. The sample view definitions are

sql
-- 1d
SELECT time_bucket('1 day'::interval, "timestamp") AS "timestamp",
    device,
    sum(count) AS count
   FROM cagg_12h
  GROUP BY (time_bucket('1 day'::interval, "timestamp")), device;

-- 1m
 SELECT time_bucket('1 mon'::interval, "timestamp") AS "timestamp",
    device,
    sum(count) AS count
   FROM cagg_1d
  GROUP BY time_bucket('1 mon'::interval, "timestamp")), device;

When I insert a row to base table I can see the data propagation til 1d CAgg but when I select for 1m I see materialized only data.

I have checked the watermark and it's not in future anymore. I force updated the watermark by running.

sql
UPDATE _timescaledb_catalog.continuous_aggs_watermark
SET watermark = _timescaledb_internal.to_unix_microseconds('2026-03-01 00:00:00+00'::timestamptz)
WHERE mat_hypertable_id = 336;

TimescaleDB version affected

2.23.1

PostgreSQL version used

16

What operating system did you use?

Ubuntu 24.04.3 x64

What installation method did you use?

Deb/Apt

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

bash

How can we reproduce the bug?

sql
create table base_table (
    timestamp timestamptz,
    device text,
    count int
);

select create_hypertable('base_table', by_range('timestamp'));

create materialized view cagg_12h with (timescaledb.continuous) as
    select
        time_bucket('12 hour', "timestamp") as timestamp,
        device,
        sum(count)
    from base_table
    group by 1, 2
with no data;

create materialized view cagg_1d with (timescaledb.continuous) as
    select
        time_bucket('1 day', "timestamp") as timestamp,
        device,
        sum(count)
    from base_table
    group by 1, 2
with no data;

create materialized view cagg_1m with (timescaledb.continuous) as
    select
        time_bucket('1 month', "timestamp") as timestamp,
        device,
        sum(count)
    from base_table
    group by 1, 2
with no data;
  1. Insert some sample data, refresh the CAgg
  2. Insert a new row
  3. Now select from 1d you should be able to see the real-time data
sql
select sum(count) from cagg_1d
where device = 'A'
group by device;
  1. But when you do same for 1m CAgg you will not get real-time data
sql
select sum(count) from cagg_1m
where device = 'A'
group by device