timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.9k stars 882 forks source link

[Bug]: core dump in PG13 and PG14 CI #4877

Closed mfundul closed 1 year ago

mfundul commented 2 years ago

What type of bug is this?

Crash

What subsystems and features are affected?

Compression

What happened?

CI produces specific core dumps consistently when running with ASAN for PG13 and PG14.

e.g. https://github.com/timescale/timescaledb/actions/runs/3308403799/jobs/5460759336

TimescaleDB version affected

2.9.0-dev

PostgreSQL version used

14.5

What operating system did you use?

Ubuntu 20.04 x64

What installation method did you use?

Other

What platform did you run on?

Other

Relevant log output and stack trace

2022-10-24T20:49:34.3231107Z #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2022-10-24T20:49:34.3332896Z (gdb) SELECT
2022-10-24T20:49:34.3333624Z     count(*)
2022-10-24T20:49:34.3334028Z FROM
2022-10-24T20:49:34.3334530Z     metrics_compressed_summary
2022-10-24T20:49:34.3335073Z WHERE
2022-10-24T20:49:34.3335587Z     bucket > _timescaledb_internal.to_timestamp(
2022-10-24T20:49:34.3338387Z         _timescaledb_internal.cagg_watermark(
2022-10-24T20:49:34.3338789Z             (SELECT
2022-10-24T20:49:34.3339161Z                 mat_hypertable_id
2022-10-24T20:49:34.3339459Z              FROM
2022-10-24T20:49:34.3339899Z                 _timescaledb_catalog.continuous_agg
2022-10-24T20:49:34.3340395Z              WHERE
2022-10-24T20:49:34.3341135Z                 user_view_name = 'metrics_compressed_summary')
2022-10-24T20:49:34.3341644Z         )
2022-10-24T20:49:34.3342333Z     );
2022-10-24T20:49:34.3342729Z 
2022-10-24T20:49:34.3343440Z (gdb) #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
2022-10-24T20:49:34.3344280Z         set = {__val = {4194304, 0, 0, 139623977288712, 0, 0, 
2022-10-24T20:49:34.3345142Z             139624229213632, 140729047643072, 0, 139624234669290, 
2022-10-24T20:49:34.3345656Z             140729047643200, 94718613169326, 128, 0, 140729047643280, 
2022-10-24T20:49:34.3346058Z             139624228632096}}
2022-10-24T20:49:34.3346452Z         pid = <optimized out>
2022-10-24T20:49:34.3347081Z         tid = <optimized out>
2022-10-24T20:49:34.3347702Z         ret = <optimized out>
2022-10-24T20:49:34.3348265Z #1  0x00007efccc78e859 in __GI_abort () at abort.c:79
2022-10-24T20:49:34.3717796Z         save_stage = 1
2022-10-24T20:49:34.3718536Z         act = {__sigaction_handler = {sa_handler = 0x7efccc921bf7, 
2022-10-24T20:49:34.3719153Z             sa_sigaction = 0x7efccc921bf7}, sa_mask = {__val = {1, 
2022-10-24T20:49:34.3719937Z               139624228991006, 3, 140729047643460, 12, 139624228991010, 
2022-10-24T20:49:34.3720677Z               18446744073709547520, 139624215224320, 94718694150168, 
2022-10-24T20:49:34.3721302Z               139623997339328, 94718613792882, 140729047643616, 
2022-10-24T20:49:34.3722541Z               140729047638016, 1, 94718613759791, 140729047644624}}, 
2022-10-24T20:49:34.3728296Z           sa_flags = -1971214336, sa_restorer = 0x2c}
2022-10-24T20:49:34.3728938Z         sigs = {__val = {32, 0 <repeats 15 times>}}
2022-10-24T20:49:34.3731109Z #2  0x0000562566daaf18 in ExceptionalCondition (
2022-10-24T20:49:34.3731925Z     conditionName=conditionName@entry=0x7efcbec3a820 "ht->fd.compression_state == HypertableCompressionEnabled", 
2022-10-24T20:49:34.3734303Z     errorType=errorType@entry=0x7efcbec376c0 "FailedAssertion", 
2022-10-24T20:49:34.3735304Z     fileName=fileName@entry=0x7efcbec377c0 "/home/runner/work/timescaledb/timescaledb/src/hypertable.c", lineNumber=lineNumber@entry=2913) at assert.c:69
2022-10-24T20:49:34.3816605Z No locals.
2022-10-24T20:49:34.3817186Z #3  0x00007efcbeab9447 in ts_hypertable_has_compression_table (
2022-10-24T20:49:34.3817884Z     ht=0x625000181870)
2022-10-24T20:49:34.3818337Z     at /home/runner/work/timescaledb/timescaledb/src/hypertable.c:2913
2022-10-24T20:49:34.3872474Z No locals.
2022-10-24T20:49:34.3873052Z #4  0x00007efcbeba5563 in timescaledb_get_relation_info_hook (
2022-10-24T20:49:34.3873715Z     root=0x6310000e20c8, relation_objectid=<optimized out>, 
2022-10-24T20:49:34.3874166Z     inhparent=<optimized out>, rel=0x7efcbd091ab0)
2022-10-24T20:49:34.3874634Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:1277
2022-10-24T20:49:34.4098753Z         ht = <optimized out>
2022-10-24T20:49:34.4099296Z #5  0x000056256648e0d1 in get_relation_info (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4099926Z     relationObjectId=<optimized out>, inhparent=inhparent@entry=false, 
2022-10-24T20:49:34.4100475Z     rel=rel@entry=0x7efcbd091ab0) at plancat.c:482
2022-10-24T20:49:34.4155775Z         varno = 4
2022-10-24T20:49:34.4156317Z         relation = 0x7efcbd1dede0
2022-10-24T20:49:34.4156788Z         hasindex = <optimized out>
2022-10-24T20:49:34.4157364Z         indexinfos = 0x7efcbd0946f0
2022-10-24T20:49:34.4157866Z         __func__ = "get_relation_info"
2022-10-24T20:49:34.4160627Z #6  0x00005625664a9a3f in build_simple_rel (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4161184Z     relid=relid@entry=4, parent=parent@entry=0x0) at relnode.c:307
2022-10-24T20:49:34.4167840Z         rel = 0x7efcbd091ab0
2022-10-24T20:49:34.4168354Z         rte = 0x6310000ebb08
2022-10-24T20:49:34.4168748Z         __func__ = "build_simple_rel"
2022-10-24T20:49:34.4169352Z #7  0x00007efcbe1fd973 in decompress_chunk_add_plannerinfo (
2022-10-24T20:49:34.4169901Z     root=root@entry=0x6310000e20c8, info=info@entry=0x6310000eba70, 
2022-10-24T20:49:34.4172342Z     chunk=chunk@entry=0x7efcbd092cd0, 
2022-10-24T20:49:34.4172804Z     chunk_rel=chunk_rel@entry=0x6310000e3fd0, 
2022-10-24T20:49:34.4175833Z     needs_sequence_num=needs_sequence_num@entry=false)
2022-10-24T20:49:34.4176455Z     at /home/runner/work/timescaledb/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:1101
2022-10-24T20:49:34.4179940Z         lc = <optimized out>
2022-10-24T20:49:34.4180434Z         compressed_index = 4
2022-10-24T20:49:34.4183579Z         compressed_chunk = <optimized out>
2022-10-24T20:49:34.4183990Z         compressed_relid = <optimized out>
2022-10-24T20:49:34.4184820Z         compressed_rel = <optimized out>
2022-10-24T20:49:34.4185610Z #8  0x00007efcbe1fe8fb in ts_decompress_chunk_generate_paths (
2022-10-24T20:49:34.4186006Z     root=root@entry=0x6310000e20c8, chunk_rel=chunk_rel@entry=0x6310000e3fd0, 
2022-10-24T20:49:34.4186371Z     ht=ht@entry=0x62500012eb38, chunk=chunk@entry=0x7efcbd092cd0)
2022-10-24T20:49:34.4186797Z     at /home/runner/work/timescaledb/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:391
2022-10-24T20:49:34.4189994Z         compressed_rel = <optimized out>
2022-10-24T20:49:34.4190285Z         lc = <optimized out>
2022-10-24T20:49:34.4190777Z         new_row_estimate = <optimized out>
2022-10-24T20:49:34.4191070Z         ht_relid = 0
2022-10-24T20:49:34.4191300Z         info = 0x6310000eba70
2022-10-24T20:49:34.4191557Z         parallel_workers = 1
2022-10-24T20:49:34.4191874Z         sort_info = {compressed_pathkeys = <optimized out>, 
2022-10-24T20:49:34.4192210Z           needs_sequence_num = <optimized out>, 
2022-10-24T20:49:34.4192675Z           can_pushdown_sort = <optimized out>, reverse = <optimized out>}
2022-10-24T20:49:34.4193077Z         parent_relids = <optimized out>
2022-10-24T20:49:34.4193365Z #9  0x00007efcbe0cda60 in tsl_set_rel_pathlist_query (root=0x6310000e20c8, 
2022-10-24T20:49:34.4193696Z     rel=0x6310000e3fd0, rti=<optimized out>, rte=<optimized out>, 
2022-10-24T20:49:34.4194075Z     ht=0x62500012eb38)
2022-10-24T20:49:34.4194487Z     at /home/runner/work/timescaledb/timescaledb/tsl/src/planner.c:114
2022-10-24T20:49:34.4239167Z         chunk = 0x7efcbd092cd0
2022-10-24T20:49:34.4239686Z #10 0x00007efcbeba93d4 in apply_optimizations (
2022-10-24T20:49:34.4240176Z     root=root@entry=0x6310000e20c8, reltype=reltype@entry=TS_REL_CHUNK_CHILD, 
2022-10-24T20:49:34.4240960Z     rel=rel@entry=0x6310000e3fd0, rte=rte@entry=0x6310000e7698, 
2022-10-24T20:49:34.4241372Z     ht=0x62500012eb38)
2022-10-24T20:49:34.4241842Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:1072
2022-10-24T20:49:34.4242632Z No locals.
2022-10-24T20:49:34.4242911Z #11 0x00007efcbebaa392 in timescaledb_set_rel_pathlist (root=0x6310000e20c8, 
2022-10-24T20:49:34.4243245Z     rel=<optimized out>, rti=<optimized out>, rte=0x6310000e7698)
2022-10-24T20:49:34.4243577Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:1219
2022-10-24T20:49:34.4250810Z         reltype = TS_REL_CHUNK_CHILD
2022-10-24T20:49:34.4251191Z         ht = <optimized out>
2022-10-24T20:49:34.4256564Z #12 0x00007efcbeb5d17c in set_rel_pathlist (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4256923Z     rel=rel@entry=0x6310000e3fd0, rti=rti@entry=2, 
2022-10-24T20:49:34.4257319Z     rte=rte@entry=0x6310000e7698)
2022-10-24T20:49:34.4257645Z     at /home/runner/work/timescaledb/timescaledb/src/import/allpaths.c:251
2022-10-24T20:49:34.4334032Z         __func__ = "set_rel_pathlist"
2022-10-24T20:49:34.4334333Z #13 0x00007efcbeb5e152 in ts_set_append_rel_pathlist (
2022-10-24T20:49:34.4334774Z     root=root@entry=0x6310000e20c8, rel=rel@entry=0x6310000e3b58, 
2022-10-24T20:49:34.4335080Z     rti=rti@entry=1, rte=rte@entry=0x6310000e1028)
2022-10-24T20:49:34.4335441Z     at /home/runner/work/timescaledb/timescaledb/src/import/allpaths.c:176
2022-10-24T20:49:34.4347104Z         appinfo = <optimized out>
2022-10-24T20:49:34.4347605Z         childRTindex = 2
2022-10-24T20:49:34.4347840Z         childRTE = 0x6310000e7698
2022-10-24T20:49:34.4348073Z         childrel = 0x6310000e3fd0
2022-10-24T20:49:34.4348299Z         l__state = {l = 0x6310000e82b0, i = 0}
2022-10-24T20:49:34.4348539Z         parentRTindex = 1
2022-10-24T20:49:34.4348777Z         live_childrels = 0x0
2022-10-24T20:49:34.4349002Z         l = <optimized out>
2022-10-24T20:49:34.4349267Z #14 0x00007efcbeba85ac in reenable_inheritance (
2022-10-24T20:49:34.4349553Z     root=root@entry=0x6310000e20c8, rel=rel@entry=0x6310000e3b58, 
2022-10-24T20:49:34.4349843Z     rti=rti@entry=1, rte=rte@entry=0x6310000e1028)
2022-10-24T20:49:34.4350167Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:1043
2022-10-24T20:49:34.4352583Z         do_distributed = <optimized out>
2022-10-24T20:49:34.4352916Z         ht = <optimized out>
2022-10-24T20:49:34.4353266Z         i = <optimized out>
2022-10-24T20:49:34.4353740Z         set_pathlist_for_current_rel = true
2022-10-24T20:49:34.4354170Z         total_pages = <optimized out>
2022-10-24T20:49:34.4354556Z         reenabled_inheritance = true
2022-10-24T20:49:34.4354944Z         __func__ = "reenable_inheritance"
2022-10-24T20:49:34.4355317Z #15 0x00007efcbebaa3ed in timescaledb_set_rel_pathlist (root=0x6310000e20c8, 
2022-10-24T20:49:34.4356015Z     rel=<optimized out>, rti=<optimized out>, rte=0x6310000e1028)
2022-10-24T20:49:34.4356704Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:1173
2022-10-24T20:49:34.4367226Z         reltype = TS_REL_HYPERTABLE
2022-10-24T20:49:34.4367628Z         ht = <optimized out>
2022-10-24T20:49:34.4368055Z #16 0x00005625662bbc82 in set_rel_pathlist (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4368523Z     rel=rel@entry=0x6310000e3b58, rti=rti@entry=1, rte=0x6310000e1028)
2022-10-24T20:49:34.4368816Z     at allpaths.c:541
2022-10-24T20:49:34.4382026Z         __func__ = "set_rel_pathlist"
2022-10-24T20:49:34.4382327Z #17 0x00005625662bc176 in set_base_rel_pathlists (
2022-10-24T20:49:34.4382681Z     root=root@entry=0x6310000e20c8) at allpaths.c:353
2022-10-24T20:49:34.4518153Z         rel = 0x6310000e3b58
2022-10-24T20:49:34.4518464Z         rti = 1
2022-10-24T20:49:34.4518825Z #18 0x00005625662be1c7 in make_one_rel (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4519177Z     joinlist=joinlist@entry=0x6310000e4f50) at allpaths.c:223
2022-10-24T20:49:34.4535436Z         rel = <optimized out>
2022-10-24T20:49:34.4535977Z         rti = <optimized out>
2022-10-24T20:49:34.4536252Z         total_pages = <optimized out>
2022-10-24T20:49:34.4536587Z #19 0x000056256639265e in query_planner (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4536974Z     qp_callback=qp_callback@entry=0x5625663944d8 <standard_qp_callback>, 
2022-10-24T20:49:34.4537335Z     qp_extra=qp_extra@entry=0x7ffe08e50710) at planmain.c:276
2022-10-24T20:49:34.4555861Z         parse = 0x6310000e0eb8
2022-10-24T20:49:34.4556137Z         joinlist = 0x6310000e4f50
2022-10-24T20:49:34.4556399Z         final_rel = <optimized out>
2022-10-24T20:49:34.4556774Z         __func__ = "query_planner"
2022-10-24T20:49:34.4557086Z #20 0x00005625663b6ca8 in grouping_planner (root=root@entry=0x6310000e20c8, 
2022-10-24T20:49:34.4557685Z     tuple_fraction=<optimized out>, tuple_fraction@entry=0) at planner.c:1442
2022-10-24T20:49:34.4587117Z         sort_input_targets = <optimized out>
2022-10-24T20:49:34.4587450Z         sort_input_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4587748Z         grouping_target = <optimized out>
2022-10-24T20:49:34.4588011Z         scanjoin_target = <optimized out>
2022-10-24T20:49:34.4588259Z         activeWindows = 0x0
2022-10-24T20:49:34.4588529Z         qp_extra = {activeWindows = <optimized out>, 
2022-10-24T20:49:34.4588795Z           groupClause = <optimized out>}
2022-10-24T20:49:34.4589078Z         sort_input_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4589471Z         have_grouping = <optimized out>
2022-10-24T20:49:34.4589715Z         wflists = 0x0
2022-10-24T20:49:34.4590049Z         gset_data = 0x0
2022-10-24T20:49:34.4590299Z         sort_input_target = <optimized out>
2022-10-24T20:49:34.4590593Z         grouping_targets = <optimized out>
2022-10-24T20:49:34.4590905Z         grouping_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4591216Z         scanjoin_targets = <optimized out>
2022-10-24T20:49:34.4597626Z         scanjoin_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4597998Z         grouping_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4598433Z         scanjoin_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4598760Z         scanjoin_target_same_exprs = <optimized out>
2022-10-24T20:49:34.4599160Z         parse = 0x6310000e0eb8
2022-10-24T20:49:34.4599428Z         offset_est = <optimized out>
2022-10-24T20:49:34.4599704Z         count_est = <optimized out>
2022-10-24T20:49:34.4600175Z         limit_tuples = -1
2022-10-24T20:49:34.4600464Z         have_postponed_srfs = <optimized out>
2022-10-24T20:49:34.4600761Z         final_target = <optimized out>
2022-10-24T20:49:34.4601048Z         final_targets = <optimized out>
2022-10-24T20:49:34.4601359Z         final_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4601674Z         final_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4602182Z         current_rel = <optimized out>
2022-10-24T20:49:34.4602490Z         final_rel = <optimized out>
2022-10-24T20:49:34.4602793Z         extra = {limit_needed = <optimized out>, 
2022-10-24T20:49:34.4603142Z           limit_tuples = <optimized out>, count_est = <optimized out>, 
2022-10-24T20:49:34.4603455Z           offset_est = <optimized out>}
2022-10-24T20:49:34.4603726Z         lc = <optimized out>
2022-10-24T20:49:34.4604104Z         __func__ = "grouping_planner"
2022-10-24T20:49:34.4604541Z #21 0x00005625663bebef in subquery_planner (glob=<optimized out>, 
2022-10-24T20:49:34.4604868Z     parse=parse@entry=0x6310000e0eb8, 
2022-10-24T20:49:34.4605173Z     parent_root=parent_root@entry=0x62d000142438, 
2022-10-24T20:49:34.4609024Z     hasRecursion=hasRecursion@entry=false, 
2022-10-24T20:49:34.4609491Z     tuple_fraction=tuple_fraction@entry=0) at planner.c:1019
2022-10-24T20:49:34.4609874Z         root = 0x6310000e20c8
2022-10-24T20:49:34.4610172Z         newWithCheckOptions = <optimized out>
2022-10-24T20:49:34.4610480Z         newHaving = <optimized out>
2022-10-24T20:49:34.4610752Z         hasOuterJoins = <optimized out>
2022-10-24T20:49:34.4611199Z         hasResultRTEs = <optimized out>
2022-10-24T20:49:34.4611481Z         final_rel = <optimized out>
2022-10-24T20:49:34.4611731Z         l = 0x0
2022-10-24T20:49:34.4612000Z #22 0x00005625662b42d5 in set_subquery_pathlist (
2022-10-24T20:49:34.4612444Z     root=root@entry=0x62d000142438, rel=rel@entry=0x6310000dfa68, 
2022-10-24T20:49:34.4615976Z     rti=rti@entry=4, rte=rte@entry=0x62d000140e88) at allpaths.c:2229
2022-10-24T20:49:34.4616306Z         parse = 0x625000006f80
2022-10-24T20:49:34.4616564Z         subquery = 0x6310000e0eb8
2022-10-24T20:49:34.4616823Z         required_outer = 0x0
2022-10-24T20:49:34.4617129Z         safetyInfo = {unsafeColumns = <optimized out>, 
2022-10-24T20:49:34.4617717Z           unsafeVolatile = <optimized out>, unsafeLeaky = <optimized out>}
2022-10-24T20:49:34.4618002Z         tuple_fraction = 0
2022-10-24T20:49:34.4618242Z         sub_final_rel = <optimized out>
2022-10-24T20:49:34.4618478Z         lc = <optimized out>
2022-10-24T20:49:34.4618756Z #23 0x00005625662b514d in set_rel_size (root=root@entry=0x62d000142438, 
2022-10-24T20:49:34.4619037Z     rel=rel@entry=0x6310000dfa68, rti=rti@entry=4, 
2022-10-24T20:49:34.4619316Z     rte=rte@entry=0x62d000140e88) at allpaths.c:423
2022-10-24T20:49:34.4619578Z         __func__ = "set_rel_size"
2022-10-24T20:49:34.4619827Z #24 0x00005625662b612a in set_append_rel_size (
2022-10-24T20:49:34.4620113Z     root=root@entry=0x62d000142438, rel=rel@entry=0x6310000df598, 
2022-10-24T20:49:34.4620427Z     rti=rti@entry=1, rte=rte@entry=0x62500025f940) at allpaths.c:1105
2022-10-24T20:49:34.4634234Z         appinfo = <optimized out>
2022-10-24T20:49:34.4634514Z         childRTindex = 4
2022-10-24T20:49:34.4634794Z         parentvars = <optimized out>
2022-10-24T20:49:34.4635071Z         childRTE = 0x62d000140e88
2022-10-24T20:49:34.4635335Z         childrel = 0x6310000dfa68
2022-10-24T20:49:34.4635610Z         childvars = <optimized out>
2022-10-24T20:49:34.4635880Z         l__state = {l = 0x6310000df030, i = 0}
2022-10-24T20:49:34.4636156Z         parentRTindex = 1
2022-10-24T20:49:34.4636421Z         has_live_children = false
2022-10-24T20:49:34.4636677Z         parent_rows = 0
2022-10-24T20:49:34.4636921Z         parent_size = 0
2022-10-24T20:49:34.4637175Z         parent_attrsizes = 0x6310000e0e60
2022-10-24T20:49:34.4637431Z         nattrs = 6
2022-10-24T20:49:34.4637663Z         l = <optimized out>
2022-10-24T20:49:34.4637971Z #25 0x00005625662b4f43 in set_rel_size (root=root@entry=0x62d000142438, 
2022-10-24T20:49:34.4638305Z     rel=rel@entry=0x6310000df598, rti=rti@entry=1, 
2022-10-24T20:49:34.4638718Z     rte=rte@entry=0x62500025f940) at allpaths.c:384
2022-10-24T20:49:34.4638993Z         __func__ = "set_rel_size"
2022-10-24T20:49:34.4639526Z #26 0x00005625662b7bf7 in set_base_rel_sizes (root=root@entry=0x62d000142438)
2022-10-24T20:49:34.4639821Z     at allpaths.c:324
2022-10-24T20:49:34.4644810Z         rel = 0x6310000df598
2022-10-24T20:49:34.4645087Z         rte = 0x62500025f940
2022-10-24T20:49:34.4645305Z         rti = 1
2022-10-24T20:49:34.4645603Z #27 0x00005625662bde73 in make_one_rel (root=root@entry=0x62d000142438, 
2022-10-24T20:49:34.4645965Z     joinlist=joinlist@entry=0x6310000df940) at allpaths.c:186
2022-10-24T20:49:34.4651122Z         rel = <optimized out>
2022-10-24T20:49:34.4651378Z         rti = <optimized out>
2022-10-24T20:49:34.4651614Z         total_pages = <optimized out>
2022-10-24T20:49:34.4652014Z #28 0x000056256639265e in query_planner (root=root@entry=0x62d000142438, 
2022-10-24T20:49:34.4652368Z     qp_callback=qp_callback@entry=0x5625663944d8 <standard_qp_callback>, 
2022-10-24T20:49:34.4652696Z     qp_extra=qp_extra@entry=0x7ffe08e50f20) at planmain.c:276
2022-10-24T20:49:34.4658765Z         parse = 0x625000006f80
2022-10-24T20:49:34.4659019Z         joinlist = 0x6310000df940
2022-10-24T20:49:34.4659258Z         final_rel = <optimized out>
2022-10-24T20:49:34.4659616Z         __func__ = "query_planner"
2022-10-24T20:49:34.4659907Z #29 0x00005625663b6ca8 in grouping_planner (root=root@entry=0x62d000142438, 
2022-10-24T20:49:34.4660437Z     tuple_fraction=<optimized out>, tuple_fraction@entry=0) at planner.c:1442
2022-10-24T20:49:34.4675202Z         sort_input_targets = <optimized out>
2022-10-24T20:49:34.4675562Z         sort_input_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4675871Z         grouping_target = <optimized out>
2022-10-24T20:49:34.4676170Z         scanjoin_target = <optimized out>
2022-10-24T20:49:34.4676445Z         activeWindows = 0x0
2022-10-24T20:49:34.4676748Z         qp_extra = {activeWindows = <optimized out>, 
2022-10-24T20:49:34.4677061Z           groupClause = <optimized out>}
2022-10-24T20:49:34.4677384Z         sort_input_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4677797Z         have_grouping = <optimized out>
2022-10-24T20:49:34.4678166Z         wflists = 0x0
2022-10-24T20:49:34.4678392Z         gset_data = 0x0
2022-10-24T20:49:34.4678738Z         sort_input_target = <optimized out>
2022-10-24T20:49:34.4679009Z         grouping_targets = <optimized out>
2022-10-24T20:49:34.4679282Z         grouping_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4679568Z         scanjoin_targets = <optimized out>
2022-10-24T20:49:34.4679847Z         scanjoin_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4680146Z         grouping_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4680443Z         scanjoin_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4680725Z         scanjoin_target_same_exprs = <optimized out>
2022-10-24T20:49:34.4680987Z         parse = 0x625000006f80
2022-10-24T20:49:34.4681220Z         offset_est = <optimized out>
2022-10-24T20:49:34.4681581Z         count_est = <optimized out>
2022-10-24T20:49:34.4681938Z         limit_tuples = -1
2022-10-24T20:49:34.4686707Z         have_postponed_srfs = <optimized out>
2022-10-24T20:49:34.4687019Z         final_target = <optimized out>
2022-10-24T20:49:34.4687309Z         final_targets = <optimized out>
2022-10-24T20:49:34.4690526Z         final_targets_contain_srfs = <optimized out>
2022-10-24T20:49:34.4690823Z         final_target_parallel_safe = <optimized out>
2022-10-24T20:49:34.4691092Z         current_rel = <optimized out>
2022-10-24T20:49:34.4691320Z         final_rel = <optimized out>
2022-10-24T20:49:34.4691579Z         extra = {limit_needed = <optimized out>, 
2022-10-24T20:49:34.4691885Z           limit_tuples = <optimized out>, count_est = <optimized out>, 
2022-10-24T20:49:34.4692171Z           offset_est = <optimized out>}
2022-10-24T20:49:34.4692524Z         lc = <optimized out>
2022-10-24T20:49:34.4692757Z         __func__ = "grouping_planner"
2022-10-24T20:49:34.4693070Z #30 0x00005625663bebef in subquery_planner (glob=glob@entry=0x62d000140d08, 
2022-10-24T20:49:34.4693433Z     parse=parse@entry=0x625000006f80, parent_root=parent_root@entry=0x0, 
2022-10-24T20:49:34.4694933Z     hasRecursion=hasRecursion@entry=false, 
2022-10-24T20:49:34.4700015Z     tuple_fraction=tuple_fraction@entry=0) at planner.c:1019
2022-10-24T20:49:34.4700343Z         root = 0x62d000142438
2022-10-24T20:49:34.4700603Z         newWithCheckOptions = <optimized out>
2022-10-24T20:49:34.4700855Z         newHaving = <optimized out>
2022-10-24T20:49:34.4701110Z         hasOuterJoins = <optimized out>
2022-10-24T20:49:34.4701487Z         hasResultRTEs = <optimized out>
2022-10-24T20:49:34.4701748Z         final_rel = <optimized out>
2022-10-24T20:49:34.4701976Z         l = 0x0
2022-10-24T20:49:34.4702260Z #31 0x00005625663c03e5 in standard_planner (parse=parse@entry=0x625000006f80, 
2022-10-24T20:49:34.4703536Z     query_string=query_string@entry=0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"..., 
2022-10-24T20:49:34.4704259Z     cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0)
2022-10-24T20:49:34.4704980Z     at planner.c:400
2022-10-24T20:49:34.4705241Z         result = <optimized out>
2022-10-24T20:49:34.4705502Z         glob = 0x62d000140d08
2022-10-24T20:49:34.4705752Z         tuple_fraction = 0
2022-10-24T20:49:34.4705992Z         root = <optimized out>
2022-10-24T20:49:34.4706256Z         final_rel = <optimized out>
2022-10-24T20:49:34.4706529Z         best_path = <optimized out>
2022-10-24T20:49:34.4706800Z         top_plan = <optimized out>
2022-10-24T20:49:34.4707061Z         lp = <optimized out>
2022-10-24T20:49:34.4707530Z         lr = <optimized out>
2022-10-24T20:49:34.4707926Z #32 0x00007efcbeba33c0 in timescaledb_planner (parse=<optimized out>, 
2022-10-24T20:49:34.4708264Z     query_string=<optimized out>, cursor_opts=<optimized out>, 
2022-10-24T20:49:34.4708545Z     bound_params=<optimized out>)
2022-10-24T20:49:34.4708854Z     at /home/runner/work/timescaledb/timescaledb/src/planner/planner.c:578
2022-10-24T20:49:34.4709181Z         context = {rootquery = <optimized out>, 
2022-10-24T20:49:34.4709592Z           current_query = <optimized out>, root = <optimized out>, 
2022-10-24T20:49:34.4709916Z           num_distributed_tables = <optimized out>}
2022-10-24T20:49:34.4710250Z         glob = {type = <optimized out>, boundParams = <optimized out>, 
2022-10-24T20:49:34.4714896Z           subplans = <optimized out>, subroots = <optimized out>, 
2022-10-24T20:49:34.4715292Z           rewindPlanIDs = <optimized out>, finalrtable = <optimized out>, 
2022-10-24T20:49:34.4715689Z           finalrowmarks = <optimized out>, resultRelations = <optimized out>, 
2022-10-24T20:49:34.4716339Z           appendRelations = <optimized out>, relationOids = <optimized out>, 
2022-10-24T20:49:34.4716753Z           invalItems = <optimized out>, paramExecTypes = <optimized out>, 
2022-10-24T20:49:34.4717151Z           lastPHId = <optimized out>, lastRowMarkId = <optimized out>, 
2022-10-24T20:49:34.4717680Z           lastPlanNodeId = <optimized out>, transientPlan = <optimized out>, 
2022-10-24T20:49:34.4718082Z           dependsOnRole = <optimized out>, parallelModeOK = <optimized out>, 
2022-10-24T20:49:34.4718436Z           parallelModeNeeded = <optimized out>, 
2022-10-24T20:49:34.4718756Z           maxParallelHazard = <optimized out>, 
2022-10-24T20:49:34.4719069Z           partition_directory = <optimized out>}
2022-10-24T20:49:34.4719398Z         root = {type = <optimized out>, parse = <optimized out>, 
2022-10-24T20:49:34.4719742Z           glob = <optimized out>, query_level = <optimized out>, 
2022-10-24T20:49:34.4720103Z           parent_root = <optimized out>, plan_params = <optimized out>, 
2022-10-24T20:49:34.4720472Z           outer_params = <optimized out>, simple_rel_array = <optimized out>, 
2022-10-24T20:49:34.4720979Z           simple_rel_array_size = <optimized out>, 
2022-10-24T20:49:34.4721277Z           simple_rte_array = <optimized out>, 
2022-10-24T20:49:34.4721755Z           append_rel_array = <optimized out>, all_baserels = <optimized out>, 
2022-10-24T20:49:34.4722109Z           nullable_baserels = <optimized out>, 
2022-10-24T20:49:34.4722445Z           join_rel_list = <optimized out>, join_rel_hash = <optimized out>, 
2022-10-24T20:49:34.4722795Z           join_rel_level = <optimized out>, join_cur_level = <optimized out>, 
2022-10-24T20:49:34.4723150Z           init_plans = <optimized out>, cte_plan_ids = <optimized out>, 
2022-10-24T20:49:34.4723608Z           multiexpr_params = <optimized out>, eq_classes = <optimized out>, 
2022-10-24T20:49:34.4723912Z           ec_merging_done = <optimized out>, 
2022-10-24T20:49:34.4724179Z           canon_pathkeys = <optimized out>, 
2022-10-24T20:49:34.4724560Z           left_join_clauses = <optimized out>, 
2022-10-24T20:49:34.4724842Z           right_join_clauses = <optimized out>, 
2022-10-24T20:49:34.4728700Z           full_join_clauses = <optimized out>, 
2022-10-24T20:49:34.4728978Z           join_info_list = <optimized out>, 
2022-10-24T20:49:34.4729360Z           all_result_relids = <optimized out>, 
2022-10-24T20:49:34.4729650Z           leaf_result_relids = <optimized out>, 
2022-10-24T20:49:34.4730081Z           append_rel_list = <optimized out>, 
2022-10-24T20:49:34.4730412Z           row_identity_vars = <optimized out>, rowMarks = <optimized out>, 
2022-10-24T20:49:34.4730784Z           placeholder_list = <optimized out>, fkey_list = <optimized out>, 
2022-10-24T20:49:34.4731160Z           query_pathkeys = <optimized out>, group_pathkeys = <optimized out>, 
2022-10-24T20:49:34.4731496Z           window_pathkeys = <optimized out>, 
2022-10-24T20:49:34.4731790Z           distinct_pathkeys = <optimized out>, 
2022-10-24T20:49:34.4732217Z           sort_pathkeys = <optimized out>, part_schemes = <optimized out>, 
2022-10-24T20:49:34.4736185Z           initial_rels = <optimized out>, upper_rels = {<optimized out>, 
2022-10-24T20:49:34.4736580Z             <optimized out>, <optimized out>, <optimized out>, 
2022-10-24T20:49:34.4736945Z             <optimized out>, <optimized out>, <optimized out>}, 
2022-10-24T20:49:34.4737329Z           upper_targets = {<optimized out>, <optimized out>, <optimized out>, 
2022-10-24T20:49:34.4737712Z             <optimized out>, <optimized out>, <optimized out>, 
2022-10-24T20:49:34.4738059Z             <optimized out>}, processed_tlist = <optimized out>, 
2022-10-24T20:49:34.4738439Z           update_colnos = <optimized out>, grouping_map = <optimized out>, 
2022-10-24T20:49:34.4738827Z           minmax_aggs = <optimized out>, planner_cxt = <optimized out>, 
2022-10-24T20:49:34.4739282Z           total_table_pages = <optimized out>, 
2022-10-24T20:49:34.4739627Z           tuple_fraction = <optimized out>, limit_tuples = <optimized out>, 
2022-10-24T20:49:34.4740073Z           qual_security_level = <optimized out>, 
2022-10-24T20:49:34.4740438Z           hasJoinRTEs = <optimized out>, hasLateralRTEs = <optimized out>, 
2022-10-24T20:49:34.4740791Z           hasHavingQual = <optimized out>, 
2022-10-24T20:49:34.4741124Z           hasPseudoConstantQuals = <optimized out>, 
2022-10-24T20:49:34.4741477Z           hasAlternativeSubPlans = <optimized out>, 
2022-10-24T20:49:34.4741856Z           hasRecursion = <optimized out>, agginfos = <optimized out>, 
2022-10-24T20:49:34.4742244Z           aggtransinfos = <optimized out>, numOrderedAggs = <optimized out>, 
2022-10-24T20:49:34.4742612Z           hasNonPartialAggs = <optimized out>, 
2022-10-24T20:49:34.4743207Z           hasNonSerialAggs = <optimized out>, wt_param_id = <optimized out>, 
2022-10-24T20:49:34.4743542Z           non_recursive_path = <optimized out>, 
2022-10-24T20:49:34.4743884Z           curOuterRels = <optimized out>, curOuterParams = <optimized out>, 
2022-10-24T20:49:34.4744264Z           isAltSubplan = <optimized out>, isUsedSubplan = <optimized out>, 
2022-10-24T20:49:34.4744900Z           join_search_private = <optimized out>, 
2022-10-24T20:49:34.4745223Z           partColsUpdated = <optimized out>}
2022-10-24T20:49:34.4745682Z         _save_exception_stack = 0x7ffe08e51ab0
2022-10-24T20:49:34.4745990Z         _save_context_stack = 0x0
2022-10-24T20:49:34.4746336Z         _local_sigjmp_buf = {{__jmpbuf = {<optimized out>, <optimized out>, 
2022-10-24T20:49:34.4746714Z               <optimized out>, <optimized out>, <optimized out>, 
2022-10-24T20:49:34.4747060Z               <optimized out>, <optimized out>, <optimized out>}, 
2022-10-24T20:49:34.4747424Z             __mask_was_saved = <optimized out>, __saved_mask = {__val = {
2022-10-24T20:49:34.4747772Z                 <optimized out> <repeats 16 times>}}}}
2022-10-24T20:49:34.4748070Z         _do_rethrow = <optimized out>
2022-10-24T20:49:34.4748341Z         stmt = <optimized out>
2022-10-24T20:49:34.4748600Z         lc = <optimized out>
2022-10-24T20:49:34.4748848Z         reset_fetcher_type = true
2022-10-24T20:49:34.4749115Z         reset_baserel_info = true
2022-10-24T20:49:34.4749391Z         __func__ = "timescaledb_planner"
2022-10-24T20:49:34.4749723Z #33 0x00005625663c37e5 in planner (parse=parse@entry=0x625000006f80, 
2022-10-24T20:49:34.4750780Z     query_string=query_string@entry=0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"..., 
2022-10-24T20:49:34.4751596Z     cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0)
2022-10-24T20:49:34.4751920Z     at planner.c:269
2022-10-24T20:49:34.4752183Z         result = <optimized out>
2022-10-24T20:49:34.4752461Z #34 0x0000562566827856 in pg_plan_query (
2022-10-24T20:49:34.4752757Z     querytree=querytree@entry=0x625000006f80, 
2022-10-24T20:49:34.4753721Z     query_string=query_string@entry=0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"..., 
2022-10-24T20:49:34.4754409Z     cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0)
2022-10-24T20:49:34.4754734Z     at postgres.c:846
2022-10-24T20:49:34.4754989Z         plan = <optimized out>
2022-10-24T20:49:34.4755305Z #35 0x00005625668280e3 in pg_plan_queries (querytrees=0x629000196660, 
2022-10-24T20:49:34.4756262Z     query_string=query_string@entry=0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"..., 
2022-10-24T20:49:34.4756941Z     cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0)
2022-10-24T20:49:34.4757280Z     at postgres.c:938
2022-10-24T20:49:34.4812992Z         query = 0x625000006f80
2022-10-24T20:49:34.4813255Z         stmt = <optimized out>
2022-10-24T20:49:34.4813537Z         query_list__state = {l = 0x629000196660, i = 0}
2022-10-24T20:49:34.4813807Z         stmt_list = 0x0
2022-10-24T20:49:34.4814049Z         query_list = 0x629000196678
2022-10-24T20:49:34.4814328Z #36 0x0000562566828b24 in exec_simple_query (
2022-10-24T20:49:34.4815369Z     query_string=query_string@entry=0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"...) at postgres.c:1132
2022-10-24T20:49:34.4833142Z         snapshot_set = true
2022-10-24T20:49:34.4833533Z         per_parsetree_context = 0x0
2022-10-24T20:49:34.4833826Z         plantree_list = <optimized out>
2022-10-24T20:49:34.4834110Z         parsetree = 0x625000006dd8
2022-10-24T20:49:34.4834383Z         commandTag = CMDTAG_SELECT
2022-10-24T20:49:34.4834725Z         qc = {commandTag = <optimized out>, nprocessed = <optimized out>}
2022-10-24T20:49:34.4835103Z         querytree_list = <optimized out>
2022-10-24T20:49:34.4835596Z         portal = <optimized out>
2022-10-24T20:49:34.4835894Z         receiver = <optimized out>
2022-10-24T20:49:34.4836177Z         format = <optimized out>
2022-10-24T20:49:34.4836481Z         parsetree_item__state = {l = 0x625000006e10, i = 0}
2022-10-24T20:49:34.4836752Z         dest = DestRemote
2022-10-24T20:49:34.4837006Z         oldcontext = 0x625000048900
2022-10-24T20:49:34.4837273Z         parsetree_list = 0x625000006e10
2022-10-24T20:49:34.4837548Z         parsetree_item = 0x625000006e28
2022-10-24T20:49:34.4837831Z         save_log_statement_stats = false
2022-10-24T20:49:34.4838083Z         was_logged = true
2022-10-24T20:49:34.4838342Z         use_implicit_block = false
2022-10-24T20:49:34.4838757Z         msec_str = {<optimized out> <repeats 32 times>}
2022-10-24T20:49:34.4839045Z         __func__ = "exec_simple_query"
2022-10-24T20:49:34.4839460Z #37 0x000056256682e1d7 in PostgresMain (argc=argc@entry=1, 
2022-10-24T20:49:34.4839827Z     argv=argv@entry=0x7ffe08e51c40, dbname=<optimized out>, 
2022-10-24T20:49:34.4840133Z     dbname@entry=0x629000020290 "single", 
2022-10-24T20:49:34.4840610Z     username=username@entry=0x629000020258 "default_perm_user")
2022-10-24T20:49:34.4840912Z     at postgres.c:4496
2022-10-24T20:49:34.4858158Z         query_string = 0x625000005220 "SELECT\n    count(*)\nFROM\n    metrics_compressed_summary\nWHERE\n    bucket > _timescaledb_internal.to_timestamp(\n        _timescaledb_internal.cagg_watermark(\n", ' ' <repeats 12 times>, "(SELECT\n", ' ' <repeats 16 times>, "mat_hyp"...
2022-10-24T20:49:34.4858759Z         firstchar = <optimized out>
2022-10-24T20:49:34.4859101Z         input_message = {data = <optimized out>, len = <optimized out>, 
2022-10-24T20:49:34.4859582Z           maxlen = <optimized out>, cursor = <optimized out>}
2022-10-24T20:49:34.4859929Z         local_sigjmp_buf = {{__jmpbuf = {<optimized out>, <optimized out>, 
2022-10-24T20:49:34.4860494Z               <optimized out>, <optimized out>, <optimized out>, 
2022-10-24T20:49:34.4860816Z               <optimized out>, <optimized out>, <optimized out>}, 
2022-10-24T20:49:34.4861138Z             __mask_was_saved = <optimized out>, __saved_mask = {__val = {
2022-10-24T20:49:34.4861443Z                 <optimized out> <repeats 16 times>}}}}
2022-10-24T20:49:34.4861705Z         send_ready_for_query = <optimized out>
2022-10-24T20:49:34.4861990Z         idle_in_transaction_timeout_enabled = false
2022-10-24T20:49:34.4862275Z         idle_session_timeout_enabled = false
2022-10-24T20:49:34.4862529Z         __func__ = "PostgresMain"
2022-10-24T20:49:34.4862809Z #38 0x000056256654e5a7 in BackendRun (port=port@entry=0x61500000b200)
2022-10-24T20:49:34.4863076Z     at postmaster.c:4530
2022-10-24T20:49:34.4863315Z         av = {<optimized out>, <optimized out>}
2022-10-24T20:49:34.4863546Z         ac = 1
2022-10-24T20:49:34.4863812Z #39 0x00005625665594a3 in BackendStartup (port=port@entry=0x61500000b200)
2022-10-24T20:49:34.4864086Z     at postmaster.c:4252
2022-10-24T20:49:34.4864309Z         bn = 0x6040000034d0
2022-10-24T20:49:34.4864823Z         pid = 0
2022-10-24T20:49:34.4865100Z         __func__ = "BackendStartup"
2022-10-24T20:49:34.4865413Z #40 0x000056256655a224 in ServerLoop () at postmaster.c:1745
2022-10-24T20:49:34.4886615Z         port = 0x61500000b200
2022-10-24T20:49:34.4886883Z         i = 0
2022-10-24T20:49:34.4887165Z         rmask = {fds_bits = {<optimized out> <repeats 16 times>}}
2022-10-24T20:49:34.4887479Z         selres = <optimized out>
2022-10-24T20:49:34.4887975Z         now = <optimized out>
2022-10-24T20:49:34.4888275Z         readmask = {fds_bits = {<optimized out> <repeats 16 times>}}
2022-10-24T20:49:34.4888556Z         nSockets = 8
2022-10-24T20:49:34.4888814Z         last_lockfile_recheck_time = 1666643518
2022-10-24T20:49:34.4889321Z         last_touch_time = 1666643518
2022-10-24T20:49:34.4889598Z         __func__ = "ServerLoop"
2022-10-24T20:49:34.4889895Z #41 0x000056256655c768 in PostmasterMain (argc=argc@entry=8, 
2022-10-24T20:49:34.4890409Z     argv=argv@entry=0x607000000480) at postmaster.c:1417
2022-10-24T20:49:34.4893985Z         opt = <optimized out>
2022-10-24T20:49:34.4907139Z         status = <optimized out>
2022-10-24T20:49:34.4907427Z         userDoption = <optimized out>
2022-10-24T20:49:34.4907908Z         listen_addr_saved = true
2022-10-24T20:49:34.4908135Z         i = <optimized out>
2022-10-24T20:49:34.4908397Z         output_config_variable = <optimized out>
2022-10-24T20:49:34.4908665Z         __func__ = "PostmasterMain"
2022-10-24T20:49:34.4908932Z #42 0x0000562566145388 in main (argc=8, argv=0x607000000480) at main.c:209
2022-10-24T20:49:34.4909210Z         do_check_root = <optimized out>
2022-10-24T20:49:34.4909430Z (gdb) quit
2022-10-24T20:49:34.5803434Z n/a (/home/runner/postgresql/bin/postgres + 0x37037e5)
2022-10-24T20:49:34.5803845Z                 #34 0x0000562566827856 n/a (/home/runner/postgresql/bin/postgres + 0x3b67856)
2022-10-24T20:49:34.5804236Z                 #35 0x00005625668280e3 n/a (/home/runner/postgresql/bin/postgres + 0x3b680e3)
2022-10-24T20:49:34.5804710Z                 #36 0x0000562566828b24 n/a (/home/runner/postgresql/bin/postgres + 0x3b68b24)
2022-10-24T20:49:34.5805385Z                 #37 0x000056256682e1d7 n/a (/home/runner/postgresql/bin/postgres + 0x3b6e1d7)
2022-10-24T20:49:34.5806264Z                 #38 0x000056256654e5a7 n/a (/home/runner/postgresql/bin/postgres + 0x388e5a7)
2022-10-24T20:49:34.5806661Z                 #39 0x00005625665594a3 n/a (/home/runner/postgresql/bin/postgres + 0x38994a3)
2022-10-24T20:49:34.5807049Z                 #40 0x000056256655a224 n/a (/home/runner/postgresql/bin/postgres + 0x389a224)
2022-10-24T20:49:34.5807437Z                 #41 0x000056256655c768 n/a (/home/runner/postgresql/bin/postgres + 0x389c768)
2022-10-24T20:49:34.5807818Z                 #42 0x0000562566145388 n/a (/home/runner/postgresql/bin/postgres + 0x3485388)
2022-10-24T20:49:34.5808168Z                 #43 0x00007efccc790083 __libc_start_main (libc.so.6 + 0x24083)
2022-10-24T20:49:34.5808554Z                 #44 0x00005625654aa4ae n/a (/home/runner/postgresql/bin/postgres + 0x27ea4ae)
2022-10-24T20:49:34.5808895Z 
2022-10-24T20:49:35.7367391Z 
2022-10-24T20:49:35.7368537Z warning: Can't open file /dev/shm/PostgreSQL.549533832 during file-backed mapping note processing
2022-10-24T20:49:35.7379488Z 
2022-10-24T20:49:35.7380023Z warning: Can't open file /SYSV004f357a (deleted) during file-backed mapping note processing
2022-10-24T20:49:35.7381561Z 
2022-10-24T20:49:35.7382031Z warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing

How can we reproduce the bug?

https://github.com/timescale/timescaledb/actions/runs/3308403799/jobs/5460759336
mfundul commented 2 years ago

More information:

=================================================================
==postgres==104001==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62500001d910 at pc 0x5635723a5543 bp 0x7ffdf9cec400 sp 0x7ffdf9cec3f0
READ of size 8 at 0x62500001d910 thread T0
    #0 0x5635723a5542 in is_redundant_derived_clause /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/equivclass.c:3087
    #1 0x7fe5acedc14c in decompress_chunk_plan_create /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/planner.c:367
    #2 0x5635724101a0 in create_customscan_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:4064
    #3 0x563572410caf in create_scan_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:744
    #4 0x563572405304 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:394
    #5 0x56357240c50e in create_append_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1177
    #6 0x563572405328 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:403
    #7 0x56357240ab4f in create_nestloop_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:4129
    #8 0x56357240b507 in create_join_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1047
    #9 0x563572405318 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:399
    #10 0x56357240e861 in create_projection_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1876
    #11 0x5635724053cf in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:415
    #12 0x5635724113cc in create_sort_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:2007
    #13 0x5635724054c7 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:465
    #14 0x56357240571d in create_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:331
    #15 0x5635724585b4 in standard_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:412
    #16 0x7fe5ad7d7d78 in timescaledb_planner /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:578
    #17 0x56357245b710 in planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:273
    #18 0x56357282b81e in pg_plan_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:875
    #19 0x563571e2bc28 in ExplainOneQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:391
    #20 0x563571e2e405 in ExplainQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:275
    #21 0x56357283f34e in standard_ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:846
    #22 0x7fe5b758e787 in loader_process_utility_hook /home/mfundul/Development/timescale/timescaledb/src/loader/loader.c:582
    #23 0x7fe5ad718969 in prev_ProcessUtility /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:95
    #24 0x7fe5ad7300b2 in timescaledb_ddl_command_start /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:4410
    #25 0x5635728401c6 in ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:520
    #26 0x5635728385fb in PortalRunUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:1153
    #27 0x5635728395f6 in FillPortalStore /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:1026
    #28 0x56357283a2ec in PortalRun /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:760
    #29 0x56357282cbc0 in exec_simple_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:1239
    #30 0x563572831d49 in PostgresMain /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:4347
    #31 0x5635725c631f in BackendRun /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:4550
    #32 0x5635725d10f2 in BackendStartup /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:4234
    #33 0x5635725d19ca in ServerLoop /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:1739
    #34 0x5635725d40c1 in PostmasterMain /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:1412
    #35 0x5635721fdb64 in main /home/mfundul/Development/timescale/postgresql-13.7/src/backend/main/main.c:210
    #36 0x7fe5baef9082 in __libc_start_main ../csu/libc-start.c:308
    #37 0x56357164046d in _start (/usr/local/pgsql/postgresql-13.7/bin/postgres+0x24e846d)

0x62500001d910 is located 16 bytes to the right of 8192-byte region [0x62500001b900,0x62500001d900)
allocated by thread T0 here:
    #0 0x56357172b0f8 in __interceptor_malloc (/usr/local/pgsql/postgresql-13.7/bin/postgres+0x25d30f8)
    #1 0x563572de0b4e in AllocSetAlloc /home/mfundul/Development/timescale/postgresql-13.7/src/backend/utils/mmgr/aset.c:919
    #2 0x563572e00215 in palloc0 /home/mfundul/Development/timescale/postgresql-13.7/src/backend/utils/mmgr/mcxt.c:994
    #3 0x5635721fdcf5 in bms_make_singleton /home/mfundul/Development/timescale/postgresql-13.7/src/backend/nodes/bitmapset.c:196
    #4 0x563572529d87 in build_simple_rel /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/util/relnode.c:210
    #5 0x7fe5aced114c in decompress_chunk_add_plannerinfo /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:1101
    #6 0x7fe5aced1e57 in ts_decompress_chunk_generate_paths /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:391
    #7 0x7fe5acdb8d02 in tsl_set_rel_pathlist_query /home/mfundul/Development/timescale/timescaledb/tsl/src/planner.c:114
    #8 0x7fe5ad7dd8c7 in apply_optimizations /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1072
    #9 0x7fe5ad7de7f0 in timescaledb_set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1219
    #10 0x7fe5ad7a47ec in set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/import/allpaths.c:251
    #11 0x7fe5ad7a4cd4 in ts_set_append_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/import/allpaths.c:176
    #12 0x7fe5ad7dcb31 in reenable_inheritance /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1043
    #13 0x7fe5ad7de84b in timescaledb_set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1173
    #14 0x5635723637bc in set_rel_pathlist /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:540
    #15 0x563572363c70 in set_base_rel_pathlists /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:352
    #16 0x563572365bcb in make_one_rel /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:222
    #17 0x5635724298b6 in query_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planmain.c:269
    #18 0x56357244c1b5 in grouping_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:2059
    #19 0x563572456d4b in subquery_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:1015
    #20 0x563572458583 in standard_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:405
    #21 0x7fe5ad7d7d78 in timescaledb_planner /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:578
    #22 0x56357245b710 in planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:273
    #23 0x56357282b81e in pg_plan_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:875
    #24 0x563571e2bc28 in ExplainOneQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:391
    #25 0x563571e2e405 in ExplainQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:275
    #26 0x56357283f34e in standard_ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:846
    #27 0x7fe5b758e787 in loader_process_utility_hook /home/mfundul/Development/timescale/timescaledb/src/loader/loader.c:582
    #28 0x7fe5ad718969 in prev_ProcessUtility /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:95
    #29 0x7fe5ad7300b2 in timescaledb_ddl_command_start /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:4410

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/equivclass.c:3087 in is_redundant_derived_clause
Shadow bytes around the buggy address:
  0x0c4a7fffbad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a7fffbae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a7fffbaf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a7fffbb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a7fffbb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c4a7fffbb20: fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a7fffbb30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a7fffbb40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a7fffbb50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a7fffbb60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a7fffbb70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==postgres==104001==ABORTING
fabriziomello commented 1 year ago

Closing because we're not seeing this issue anymore.