Skip to content

Commit

Permalink
Fix OSM chunks exclusion from append paths
Browse files Browse the repository at this point in the history
OSM chunks have their own fdw_private which conflicts with checks in
the MergeAppend code path causing segfaults. This commit fixes this by
returning early when there is an OSM chunk in the MergeAppendPath.
  • Loading branch information
zilder committed Apr 3, 2023
1 parent 517dee9 commit c6b9f50
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/planner/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,12 @@ should_chunk_append(Hypertable *ht, PlannerInfo *root, RelOptInfo *rel, Path *pa
if (!ordered || path->pathkeys == NIL || list_length(merge->subpaths) == 0)
return false;

/* cannot support ordered append with OSM chunks. OSM chunk
* ranges are not recorded with the catalog
*/
if (ht && ts_chunk_get_osm_chunk_id(ht->fd.id) != INVALID_CHUNK_ID)
return false;

/*
* Check for partial compressed chunks.
*
Expand All @@ -913,11 +919,6 @@ should_chunk_append(Hypertable *ht, PlannerInfo *root, RelOptInfo *rel, Path *pa
}
}

/* cannot support ordered append with OSM chunks. OSM chunk
* ranges are not recorded with the catalog
*/
if (ht && ts_chunk_get_osm_chunk_id(ht->fd.id) != INVALID_CHUNK_ID)
return false;
pk = linitial_node(PathKey, path->pathkeys);

/*
Expand Down

0 comments on commit c6b9f50

Please sign in to comment.