pipelinedb: Segfault joining stream with partitioned table

background worker segfaults when a continuous view tries to join a stream value to a record of a partition

The users table is partitioned with pg 10 declarative list partitioning

CREATE FOREIGN TABLE ping_stream(
  user_id UUID,
	session_id TEXT,
	session_start_time TIMESTAMPTZ,
	organization_id UUID
) SERVER pipelinedb;
CREATE VIEW online_users

AS
  SELECT 
	  user_id, arrival_timestamp, name
FROM ping_stream
inner join users on users.id = ping_stream.user_id
                      postgres | Segmentation fault (PID 1613)
                      postgres | PostgreSQL version: 10.5 (Debian 10.5-2.pgdg90+1)
                      postgres | PipelineDB version: 1.0.0 at revision 12a01a3107dfac74b33e7ae3086a44f6d05edfab
                      postgres | query: online_users
                      postgres | backtrace:
                      postgres | /usr/lib/postgresql/10/lib/pipelinedb.so(debug_segfault+0x33)[0x7f8b25a2d193]
                      postgres | /lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0)[0x7f8b2de6b0c0]
                      postgres | postgres: bgworker: worker0 [help]   (ExecLockNonLeafAppendTables+0x3a)[0x559e7d56213a]
                      postgres | postgres: bgworker: worker0 [help]   (ExecInitAppend+0x44)[0x559e7d565084]
                      postgres | postgres: bgworker: worker0 [help]   (ExecInitNode+0x3cd)[0x559e7d55defd]
                      postgres | postgres: bgworker: worker0 [help]   (ExecInitHashJoin+0xab)[0x559e7d56eceb]
                      postgres | postgres: bgworker: worker0 [help]   (ExecInitNode+0x1d3)[0x559e7d55dd03]
                      postgres | /usr/lib/postgresql/10/lib/pipelinedb.so(+0x5282f)[0x7f8b259f682f]
                      postgres | /usr/lib/postgresql/10/lib/pipelinedb.so(ContinuousQueryWorkerMain+0x235)[0x7f8b259f6d25]
                      postgres | /usr/lib/postgresql/10/lib/pipelinedb.so(cont_bgworker_main+0x220)[0x7f8b25a2de70]
                      postgres | postgres: bgworker: worker0 [help]   (StartBackgroundWorker+0x2cc)[0x559e7d61570c]
                      postgres | postgres: bgworker: worker0 [help]   (+0x30d445)[0x559e7d622445]
                      postgres | postgres: bgworker: worker0 [help]   (+0x30e005)[0x559e7d623005]
                      postgres | /lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0)[0x7f8b2de6b0c0]
                      postgres | /lib/x86_64-linux-gnu/libc.so.6(__select+0x13)[0x7f8b2bb003a3]
                      postgres | postgres: bgworker: worker0 [help]   (+0xb2f75)[0x559e7d3c7f75]
                      postgres | postgres: bgworker: worker0 [help]   (PostmasterMain+0xfea)[0x559e7d62434a]
                      postgres | postgres: bgworker: worker0 [help]   (main+0x854)[0x559e7d3c9f74]
                      postgres | /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f8b2ba3f2e1]
                      postgres | postgres: bgworker: worker0 [help]   (_start+0x2a)[0x559e7d3ca02a]
                      postgres | 2018-12-15 05:17:48.475 UTC [1] LOG:  worker process: worker0 [help] (PID 1613) exited with exit code 1

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Sweet! thank you. will give it a try as soon as I can

Sent over a couple sql files for you. Sorry for the delay. Holidays caught up with me.

CREATE TABLE public.users
(
    id uuid NOT NULL DEFAULT gen_random_uuid(),
    organization_id uuid NOT NULL,
    name text COLLATE pg_catalog."default",
    email text COLLATE pg_catalog."default",
    hashed_password text COLLATE pg_catalog."default",
    created_at timestamp with time zone DEFAULT (now())::timestamp(6) with time zone,
    created_by uuid,
    modified_at timestamp with time zone DEFAULT (now())::timestamp(6) with time zone,
    modified_by uuid,
    archived boolean NOT NULL DEFAULT false,
    archived_at timestamp with time zone,
    archived_by uuid,
    avatar_url text COLLATE pg_catalog."default",
    phone_country_code text COLLATE pg_catalog."default" DEFAULT '1'::text,
    phone_area_code text COLLATE pg_catalog."default",
    phone_number text COLLATE pg_catalog."default",
    phone_extension text COLLATE pg_catalog."default",
    spam boolean NOT NULL DEFAULT false,
    activated boolean NOT NULL DEFAULT false,
    vanity_id integer NOT NULL DEFAULT 0,
    persona user_persona COLLATE pg_catalog."default" NOT NULL DEFAULT ('visitor'::text)::user_persona,
    source user_source COLLATE pg_catalog."default" NOT NULL,
    roles user_role[] NOT NULL,
    last_seen_at timestamp with time zone,
    signed_up_at timestamp with time zone NOT NULL DEFAULT (now())::timestamp(6) with time zone,
    last_contacted_at timestamp with time zone,
    last_heard_from timestamp with time zone,
    external_id text COLLATE pg_catalog."default",
    CONSTRAINT customer_and_lead_requires_email CHECK (persona::text <> 'customer'::text AND persona::text <> 'lead'::text OR email IS NOT NULL)
) PARTITION BY LIST (organization_id) ;

user_persona, user_source and roles are of a DOMAIN type that uses a TEXT field.