Skip to content

[Bug]: Telemetry worker crashes postgresql #9079

@pantonis

Description

@pantonis

What type of bug is this?

Crash

What subsystems and features are affected?

Other

What happened?

We see random crashes of postgresql server.

TimescaleDB version affected

2.24.0

PostgreSQL version used

18.1 - PostgreSQL 18.1 (Ubuntu 18.1-1.pgdg24.04+2) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, 64-bit

What operating system did you use?

Ubuntu 24..4

What installation method did you use?

Deb/Apt

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

`
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `postgres: 18/main: Telemetry Reporter [1]                                     '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  ts_dimension_get_partition_type (dim=0x0) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/dimension.c:883

Thread 1 (Thread 0x747b8e819a80 (LWP 117965)):
#0  ts_dimension_get_partition_type (dim=0x0) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/dimension.c:883
#1  0x0000747b8def73e0 in continuous_agg_init (cagg=0x5a2c30c02018, fd=0x7ffcd2aef640) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/ts_catalog/continuous_agg.c:489
#2  0x0000747b8def784e in ts_continuous_agg_find_by_view_name (schema=<optimized out>, name=<optimized out>, type=type@entry=ContinuousAggUserView) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/ts_catalog/continuous_agg.c:725
#3  0x0000747b8def78be in ts_continuous_agg_find_userview_name (name=<optimized out>, schema=<optimized out>) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/ts_catalog/continuous_agg.c:733
#4  0x0000747b8def8e51 in classify_view (htcache=<optimized out>, cagg=<synthetic pointer>, class=0x74779495c8b8) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/stats.c:150
#5  classify_relation (cagg=<synthetic pointer>, chunk=<synthetic pointer>, ht=<synthetic pointer>, htcache=<optimized out>, class=0x74779495c8b8) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/stats.c:177
#6  ts_telemetry_stats_gather (stats=0x7ffcd2aefa00) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/stats.c:490
#7  build_telemetry_report () at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/telemetry.c:920
#8  0x0000747b8df0e029 in ts_build_version_request (host=0x747b8df19088 "telemetry.timescale.com", path=0x747b8df19157 "/v1/metrics") at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/telemetry.c:1054
#9  ts_telemetry_main.constprop.0 (service=0x747b8df19082 "https", path=0x747b8df19157 "/v1/metrics", host=0x747b8df19088 "telemetry.timescale.com") at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/telemetry/telemetry.c:1145
#10 0x0000747b8deedc61 in ts_bgw_job_run_and_set_next_start (job=job@entry=0x5a2c30b0d070, func=0x747b8deef990 <ts_telemetry_main_wrapper>, initial_runs=initial_runs@entry=12, next_interval=next_interval@entry=0x7ffcd2af0450, atomic=atomic@entry=true, mark=mark@entry=false) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/bgw/job.c:1386
#11 0x0000747b8deee20f in ts_bgw_job_execute (job=0x5a2c30b0d070) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/bgw/job.c:1038
#12 ts_bgw_job_execute (job=0x5a2c30b0d070) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/bgw/job.c:1025
#13 ts_bgw_job_entrypoint (fcinfo=<optimized out>) at /usr/src/timescaledb-2-postgresql-18-2.24.0~ubuntu24.04-1801/src/bgw/job.c:1238
#14 0x00005a2c0098eae5 in BackgroundWorkerMain (startup_data=<optimized out>, startup_data_len=<optimized out>) at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/bgworker.c:843
#15 0x00005a2c009975f8 in postmaster_child_launch (child_type=child_type@entry=B_BG_WORKER, child_slot=245, startup_data=<optimized out>, startup_data_len=startup_data_len@entry=1472, client_sock=client_sock@entry=0x0) at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/launch_backend.c:290
#16 0x00005a2c00998d82 in StartBackgroundWorker (rw=0x5a2c30b154c8) at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/postmaster.c:4157
#17 maybe_start_bgworkers () at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/postmaster.c:4323
#18 0x00005a2c00c43f64 in LaunchMissingBackgroundProcesses () at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/postmaster.c:3397
#19 ServerLoop.isra.0 () at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/postmaster.c:1717
#20 0x00005a2c0099a65b in PostmasterMain (argc=<optimized out>, argv=<optimized out>) at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/postmaster/postmaster.c:1400
#21 0x00005a2c00620b18 in main (argc=5, argv=0x5a2c30a6abd0) at /usr/src/postgresql-18-18.1-1.pgdg24.04+2/build/../src/backend/main/main.c:227

`

How can we reproduce the bug?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv2.24.0TimescaleDB version 2.24.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions