Closed phemmer closed 2 years ago
@phemmer I assume that haproxy_agg_instance_host_1m
is a continuous aggregate. Could you add the definition of the continuous aggregate and the associated hypertable?
No, it's not a continuous aggregate, but it is a view. However even if I query the underlying table directly (substitute haproxy_agg_instance_host_1m
with the underlying table name _haproxy_agg_instance_host_1m
), the issue still occurs.
Below is the underlying table:
# \d+ _haproxy_agg_instance_host_1m
Table "public._haproxy_agg_instance_host_1m"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
---------------+-----------------------------+-----------+----------+---------+----------+--------------+-------------
time | timestamp without time zone | | not null | | plain | |
instance | text | | | | extended | |
host | text | | | | extended | |
http_response | numeric | | | | main | |
bin | numeric | | | | main | |
bout | numeric | | | | main | |
errors | numeric | | | | main | |
Indexes:
"_haproxy_agg_instance_host_1m_host_time_idx" btree (host, "time" DESC)
"_haproxy_agg_instance_host_1m_time_idx" btree ("time" DESC)
Triggers:
ts_insert_blocker BEFORE INSERT ON _haproxy_agg_instance_host_1m FOR EACH ROW EXECUTE FUNCTION _timescaledb_internal.insert_blocker()
Child tables: _timescaledb_internal._dist_hyper_3191_11531_chunk,
_timescaledb_internal._dist_hyper_3191_11532_chunk,
_timescaledb_internal._dist_hyper_3191_11554_chunk,
...
I'm able to reliably reproduce it (at least on my cluster). I don't know how much of the below is actually necessary, but here it is:
create table test (time timestamp, instance text, host text, http_response bigint, bin bigint, bout bigint, errors bigint);
create index on test (host, time desc);
select create_distributed_hypertable('test',
'time',
partitioning_column => 'host',
number_partitions => 2,
replication_factor => 2,
chunk_time_interval => interval '1h');
alter table test set (timescaledb.compress, timescaledb.compress_segmentby = 'host');
insert into test values
('2021-10-15T00:00:00','a','a',1,2,3,4),
('2021-10-15T00:00:00','a','b',1,2,3,4),
('2021-10-15T00:00:00','a','c',1,2,3,4),
('2021-10-15T00:00:00','a','d',1,2,3,4),
('2021-10-15T01:00:00','a','a',1,2,3,4),
('2021-10-15T01:00:00','a','b',1,2,3,4),
('2021-10-15T01:00:00','a','c',1,2,3,4),
('2021-10-15T01:00:00','a','d',1,2,3,4),
('2021-10-15T02:00:00','a','a',1,2,3,4),
('2021-10-15T02:00:00','a','b',1,2,3,4),
('2021-10-15T02:00:00','a','c',1,2,3,4),
('2021-10-15T02:00:00','a','d',1,2,3,4),
('2021-10-15T03:00:00','a','a',1,2,3,4),
('2021-10-15T03:00:00','a','b',1,2,3,4),
('2021-10-15T03:00:00','a','c',1,2,3,4),
('2021-10-15T03:00:00','a','d',1,2,3,4)
;
select compress_chunk(show_chunks) from show_chunks('test', older_than => '2021-10-15T02:00:00'::timestamp);
select
time_bucket('2s',"time") AS "time",
host,
sum("errors") / nullif(sum("http_response"),0)
FROM test
WHERE
"time" BETWEEN '2021-10-15T00:02:00.000Z' AND '2021-10-15T00:03:00.000Z'
AND instance in ('a')
AND host in ('a','b')
GROUP BY "time", host;
Relevant system information:
postgres --version
): postgres (PostgreSQL) 13.4 (Debian 13.4-1.pgdg100+1)\dx
inpsql
): 2.4.1Describe the bug timescaledb segfaults during a query
To Reproduce Unsure. Sometimes it works, sometimes (a lot of times) it doesn't. All of a sudden started without obvious explanation. Does it on multiple different queries.
The segfault is on the access node of a multi-node cluster.
Here's one example query, one similar to the gdb output below (just different values):
Expected behavior no segfault
Actual behavior segfault
Screenshots
Additional context Add any other context about the problem here.